Class: Rephrase::FakeNode
- Inherits:
-
Object
- Object
- Rephrase::FakeNode
- Defined in:
- lib/rephrase.rb
Overview
Class for faking a node
Instance Attribute Summary collapse
-
#children ⇒ Array
readonly
Node children.
-
#type ⇒ Symbol
readonly
Node type.
Class Method Summary collapse
-
.iter_scope(children) ⇒ Object
Constructs a FakeNode with type
:ITER_SCOPE. -
.list(children) ⇒ Object
Constructs a FakeNode with type
:LIST_EMBEDDED.
Instance Method Summary collapse
-
#initialize(type, children) ⇒ FakeNode
constructor
Initializes a FakeNode.
Constructor Details
#initialize(type, children) ⇒ FakeNode
Initializes a FakeNode.
32 33 34 35 |
# File 'lib/rephrase.rb', line 32 def initialize(type, children) @type = type @children = children end |
Instance Attribute Details
#children ⇒ Array (readonly)
Node children
27 28 29 |
# File 'lib/rephrase.rb', line 27 def children @children end |
#type ⇒ Symbol (readonly)
Node type
23 24 25 |
# File 'lib/rephrase.rb', line 23 def type @type end |
Class Method Details
.iter_scope(children) ⇒ Object
Constructs a FakeNode with type :ITER_SCOPE.
17 18 19 |
# File 'lib/rephrase.rb', line 17 def self.iter_scope(children) new(:ITER_SCOPE, children) end |
.list(children) ⇒ Object
Constructs a FakeNode with type :LIST_EMBEDDED.
11 12 13 |
# File 'lib/rephrase.rb', line 11 def self.list(children) new(:LIST_EMBEDDED, children) end |