Class: J::Expression
- Inherits:
-
Struct
- Object
- Struct
- J::Expression
- Defined in:
- lib/affidavit/j.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#label ⇒ Object
Returns the value of attribute label.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
40 41 42 |
# File 'lib/affidavit/j.rb', line 40 def args @args end |
#label ⇒ Object
Returns the value of attribute label
40 41 42 |
# File 'lib/affidavit/j.rb', line 40 def label @label end |
#metadata ⇒ Object
Returns the value of attribute metadata
40 41 42 |
# File 'lib/affidavit/j.rb', line 40 def end |
#operation ⇒ Object
Returns the value of attribute operation
40 41 42 |
# File 'lib/affidavit/j.rb', line 40 def operation @operation end |
#receiver ⇒ Object
Returns the value of attribute receiver
40 41 42 |
# File 'lib/affidavit/j.rb', line 40 def receiver @receiver end |
Instance Method Details
#__is__J__ ⇒ Object
47 48 49 |
# File 'lib/affidavit/j.rb', line 47 def __is__J__ true end |
#as_json ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/affidavit/j.rb', line 51 def as_json(...) { value: value, label: label, metadata: , spec: { receiver: receiver.as_json(...), operation: operation.as_json(...), args: args.map { _1.as_json(...) } } } end |
#value ⇒ Object
41 42 43 44 45 |
# File 'lib/affidavit/j.rb', line 41 def value return @value if defined?(@value) @value = J.reify(receiver).public_send(J.reify(operation), *args.map { J.reify(_1) }) end |