Class: LL::Operator
- Inherits:
-
Object
- Object
- LL::Operator
- Defined in:
- lib/ll/operator.rb
Overview
Class for operators such as + and *.
Instance Attribute Summary collapse
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
-
#source_line ⇒ Object
readonly
Returns the value of attribute source_line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, receiver, source_line) ⇒ Operator
constructor
A new instance of Operator.
- #inspect ⇒ String
Constructor Details
#initialize(type, receiver, source_line) ⇒ Operator
Returns a new instance of Operator.
13 14 15 16 17 |
# File 'lib/ll/operator.rb', line 13 def initialize(type, receiver, source_line) @type = type @receiver = receiver @source_line = source_line end |
Instance Attribute Details
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def receiver @receiver end |
#source_line ⇒ Object (readonly)
Returns the value of attribute source_line.
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def source_line @source_line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def type @type end |
Instance Method Details
#inspect ⇒ String
22 23 24 |
# File 'lib/ll/operator.rb', line 22 def inspect return "Operator(type: #{type.inspect}, receiver: #{receiver.inspect})" end |