Class: Curly::Parser::Block
- Inherits:
-
Object
- Object
- Curly::Parser::Block
- Defined in:
- lib/curly/parser.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #<<(node) ⇒ Object
- #==(other) ⇒ Object
- #closed_by?(component) ⇒ Boolean
-
#initialize(type, component, nodes = []) ⇒ Block
constructor
A new instance of Block.
- #to_s ⇒ Object
Constructor Details
#initialize(type, component, nodes = []) ⇒ Block
Returns a new instance of Block.
75 76 77 |
# File 'lib/curly/parser.rb', line 75 def initialize(type, component, nodes = []) @type, @component, @nodes = type, component, nodes end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
73 74 75 |
# File 'lib/curly/parser.rb', line 73 def component @component end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
73 74 75 |
# File 'lib/curly/parser.rb', line 73 def nodes @nodes end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
73 74 75 |
# File 'lib/curly/parser.rb', line 73 def type @type end |
Instance Method Details
#<<(node) ⇒ Object
89 90 91 |
# File 'lib/curly/parser.rb', line 89 def <<(node) @nodes << node end |
#==(other) ⇒ Object
93 94 95 96 97 |
# File 'lib/curly/parser.rb', line 93 def ==(other) other.type == type && other.component == component && other.nodes == nodes end |
#closed_by?(component) ⇒ Boolean
79 80 81 82 83 |
# File 'lib/curly/parser.rb', line 79 def closed_by?(component) self.component.name == component.name && self.component.identifier == component.identifier && self.component.contexts == component.contexts end |
#to_s ⇒ Object
85 86 87 |
# File 'lib/curly/parser.rb', line 85 def to_s component.to_s end |