Class: DissociatedIntrospection::MethodCall::Argument
- Inherits:
-
Object
- Object
- DissociatedIntrospection::MethodCall::Argument
- Defined in:
- lib/dissociated_introspection/method_call.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
Instance Method Summary collapse
-
#initialize(ast) ⇒ Argument
constructor
A new instance of Argument.
- #to_h ⇒ Object
- #type ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(ast) ⇒ Argument
Returns a new instance of Argument.
53 54 55 |
# File 'lib/dissociated_introspection/method_call.rb', line 53 def initialize(ast) @ast = ast end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
51 52 53 |
# File 'lib/dissociated_introspection/method_call.rb', line 51 def ast @ast end |
Instance Method Details
#to_h ⇒ Object
70 71 72 |
# File 'lib/dissociated_introspection/method_call.rb', line 70 def to_h { type: type, value: value } end |
#type ⇒ Object
57 58 59 |
# File 'lib/dissociated_introspection/method_call.rb', line 57 def type ast.type end |
#value ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/dissociated_introspection/method_call.rb', line 61 def value case type when :block Block.new(ast.children) else ast.children[0] end end |