Class: Paru::PandocFilter::ListAttributes
- Inherits:
-
Object
- Object
- Paru::PandocFilter::ListAttributes
- Defined in:
- lib/paru/filter/list_attributes.rb
Overview
ListAttributes represent the attributes of a list.
Constant Summary collapse
- STYLES =
The various styles of list numbers
[ "DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha" ]
- DELIMS =
The various delimeters of list numbers
[ "DefaultDelim", "Period", "OneParen", "TwoParens" ]
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ListAttributes
constructor
Create a new ListAttribute object with attributes.
-
#to_ast ⇒ Object
Create an AST representation of this ListAttributes object.
Constructor Details
#initialize(attributes) ⇒ ListAttributes
Create a new ListAttribute object with attributes
60 61 62 63 64 |
# File 'lib/paru/filter/list_attributes.rb', line 60 def initialize(attributes) @start = attributes[0] @number_style = attributes[1] @number_delim = attributes[2] end |
Instance Attribute Details
#number_delim ⇒ DELIMS
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/paru/filter/list_attributes.rb', line 33 class ListAttributes # The various styles of list numbers STYLES = [ "DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha" ] # The various delimeters of list numbers DELIMS = [ "DefaultDelim", "Period", "OneParen", "TwoParens" ] attr_accessor :start, :number_style, :number_delim # Create a new ListAttribute object with attributes # # @param attributes [Array] an array with start, number style, and # number delimeter def initialize(attributes) @start = attributes[0] @number_style = attributes[1] @number_delim = attributes[2] end # Create an AST representation of this ListAttributes object def to_ast() [ @start, @number_style, @number_delim ] end end |
#number_style ⇒ STYLES
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/paru/filter/list_attributes.rb', line 33 class ListAttributes # The various styles of list numbers STYLES = [ "DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha" ] # The various delimeters of list numbers DELIMS = [ "DefaultDelim", "Period", "OneParen", "TwoParens" ] attr_accessor :start, :number_style, :number_delim # Create a new ListAttribute object with attributes # # @param attributes [Array] an array with start, number style, and # number delimeter def initialize(attributes) @start = attributes[0] @number_style = attributes[1] @number_delim = attributes[2] end # Create an AST representation of this ListAttributes object def to_ast() [ @start, @number_style, @number_delim ] end end |
#start ⇒ Integer
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/paru/filter/list_attributes.rb', line 33 class ListAttributes # The various styles of list numbers STYLES = [ "DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha" ] # The various delimeters of list numbers DELIMS = [ "DefaultDelim", "Period", "OneParen", "TwoParens" ] attr_accessor :start, :number_style, :number_delim # Create a new ListAttribute object with attributes # # @param attributes [Array] an array with start, number style, and # number delimeter def initialize(attributes) @start = attributes[0] @number_style = attributes[1] @number_delim = attributes[2] end # Create an AST representation of this ListAttributes object def to_ast() [ @start, @number_style, @number_delim ] end end |
Instance Method Details
#to_ast ⇒ Object
Create an AST representation of this ListAttributes object
67 68 69 70 71 72 73 |
# File 'lib/paru/filter/list_attributes.rb', line 67 def to_ast() [ @start, @number_style, @number_delim ] end |