Class: Chelsy::Operator::Subscription
Overview
=== 6.5.2.1 Array subscripting
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Attributes inherited from Unary
Attributes inherited from Element
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(subscriptee, index, **rest) ⇒ Subscription
constructor
A new instance of Subscription.
- #subscriptee ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(subscriptee, index, **rest) ⇒ Subscription
Returns a new instance of Subscription.
594 595 596 597 |
# File 'lib/chelsy/ast.rb', line 594 def initialize(subscriptee, index, **rest) @index = Syntax::Expr.ensure(index) super subscriptee, **rest end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
590 591 592 |
# File 'lib/chelsy/ast.rb', line 590 def index @index end |
Class Method Details
.operator ⇒ Object
592 |
# File 'lib/chelsy/ast.rb', line 592 def self.operator; :"[]" end |
Instance Method Details
#subscriptee ⇒ Object
599 |
# File 'lib/chelsy/ast.rb', line 599 def subscriptee; operand end |