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)
-
- (Object) receiver
readonly
Returns the value of attribute receiver.
-
- (Object) source_line
readonly
Returns the value of attribute source_line.
-
- (Object) type
readonly
Returns the value of attribute type.
Instance Method Summary (collapse)
-
- (Operator) initialize(type, receiver, source_line)
constructor
A new instance of Operator.
-
- (String) inspect
Constructor Details
- (Operator) initialize(type, receiver, source_line)
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
- (Object) receiver (readonly)
Returns the value of attribute receiver
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def receiver @receiver end |
- (Object) source_line (readonly)
Returns the value of attribute source_line
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def source_line @source_line end |
- (Object) type (readonly)
Returns the value of attribute type
6 7 8 |
# File 'lib/ll/operator.rb', line 6 def type @type end |
Instance Method Details
- (String) inspect
22 23 24 |
# File 'lib/ll/operator.rb', line 22 def inspect return "Operator(type: #{type.inspect}, receiver: #{receiver.inspect})" end |