Class: Kumi::Core::IRV2::Value
- Inherits:
-
Object
- Object
- Kumi::Core::IRV2::Value
- Defined in:
- lib/kumi/core/irv2/value.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#elem_stamps ⇒ Object
readonly
Returns the value of attribute elem_stamps.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#stamp ⇒ Object
readonly
Returns the value of attribute stamp.
Instance Method Summary collapse
-
#initialize(id, op, args, attrs, stamp: nil, elem_stamps: nil) ⇒ Value
constructor
A new instance of Value.
- #to_s ⇒ Object
Constructor Details
#initialize(id, op, args, attrs, stamp: nil, elem_stamps: nil) ⇒ Value
Returns a new instance of Value.
11 12 13 14 15 16 17 18 |
# File 'lib/kumi/core/irv2/value.rb', line 11 def initialize(id, op, args, attrs, stamp: nil, elem_stamps: nil) @id = id @op = op @args = args @attrs = attrs @stamp = stamp @elem_stamps = elem_stamps end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def args @args end |
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def attrs @attrs end |
#elem_stamps ⇒ Object (readonly)
Returns the value of attribute elem_stamps.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def elem_stamps @elem_stamps end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def id @id end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def op @op end |
#stamp ⇒ Object (readonly)
Returns the value of attribute stamp.
9 10 11 |
# File 'lib/kumi/core/irv2/value.rb', line 9 def stamp @stamp end |
Instance Method Details
#to_s ⇒ Object
20 21 22 23 24 |
# File 'lib/kumi/core/irv2/value.rb', line 20 def to_s a = args.map { |x| x.is_a?(Value) ? "%#{x.id}" : x.inspect }.join(", ") attrs_s = attrs.empty? ? "" : " " + attrs.map { |k, v| "#{k}: #{v.inspect}" }.join(", ") format("%%%d = %s(%s)%s", id, op, a, attrs_s) end |