Class: Code::Node::If::Else
- Inherits:
-
Object
- Object
- 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(else_parsed) ⇒ Else
constructor
A new instance of Else.
Constructor Details
#initialize(else_parsed) ⇒ Else
Returns a new instance of Else.
8 9 10 11 12 13 14 15 16 |
# File 'lib/code/node/if.rb', line 8 def initialize(else_parsed) if else_parsed.key?(:operator) @operator = else_parsed.fetch(:operator) @statement = ::Code::Node::Statement.new(else_parsed.fetch(:statement)) end @body = ::Code::Node::Code.new(else_parsed.fetch(:body)) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
18 19 20 |
# File 'lib/code/node/if.rb', line 18 def body @body end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
18 19 20 |
# File 'lib/code/node/if.rb', line 18 def operator @operator end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
18 19 20 |
# File 'lib/code/node/if.rb', line 18 def statement @statement end |