Class: Code::Node::If::Else
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::If::Else
- Defined in:
- lib/code/node/if.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Instance Method Summary collapse
-
#initialize(parsed) ⇒ Else
constructor
A new instance of Else.
Methods inherited from Code::Node
Constructor Details
#initialize(parsed) ⇒ Else
Returns a new instance of Else.
12 13 14 15 16 17 18 19 |
# File 'lib/code/node/if.rb', line 12 def initialize(parsed) @operator = parsed.delete(:operator) @body = Node::Code.new(parsed.delete(:body)) if parsed.key?(:statement) @statement = Node::Statement.new(parsed.delete(:statement)) end end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/code/node/if.rb', line 10 def body @body end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
10 11 12 |
# File 'lib/code/node/if.rb', line 10 def operator @operator end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
10 11 12 |
# File 'lib/code/node/if.rb', line 10 def statement @statement end |