Class: J::Short
- Inherits:
-
Struct
- Object
- Struct
- J::Short
- 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
65 66 67 |
# File 'lib/affidavit/j.rb', line 65 def args @args end |
#label ⇒ Object
Returns the value of attribute label
65 66 67 |
# File 'lib/affidavit/j.rb', line 65 def label @label end |
#metadata ⇒ Object
Returns the value of attribute metadata
65 66 67 |
# File 'lib/affidavit/j.rb', line 65 def end |
#operation ⇒ Object
Returns the value of attribute operation
65 66 67 |
# File 'lib/affidavit/j.rb', line 65 def operation @operation end |
#receiver ⇒ Object
Returns the value of attribute receiver
65 66 67 |
# File 'lib/affidavit/j.rb', line 65 def receiver @receiver end |
Instance Method Details
#as_json ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/affidavit/j.rb', line 71 def as_json(...) resolve { value: value, label: label, metadata: , spec: { operation: operation, inspected: @inspected.as_json(...), } } end |
#resolve ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/affidavit/j.rb', line 85 def resolve return if defined?(@value) @inspected = [] @value = receiver.public_send(operation) { |c| @inspected << c c.value } end |
#value ⇒ Object
66 67 68 69 |
# File 'lib/affidavit/j.rb', line 66 def value resolve @value end |