Class: DissociatedIntrospection::RubyClass::Def

Inherits:
Object
  • Object
show all
Defined in:
lib/dissociated_introspection/ruby_class.rb

Instance Method Summary collapse

Constructor Details

#initialize(ast:) ⇒ Def

Returns a new instance of Def.



52
53
54
# File 'lib/dissociated_introspection/ruby_class.rb', line 52

def initialize(ast:)
  @ast = ast
end

Instance Method Details

#argumentsObject



60
61
62
# File 'lib/dissociated_introspection/ruby_class.rb', line 60

def arguments
  Unparser.unparse(ast.children[1])
end

#bodyObject



64
65
66
# File 'lib/dissociated_introspection/ruby_class.rb', line 64

def body
  Unparser.unparse(ast.children[2])
end

#nameObject



56
57
58
# File 'lib/dissociated_introspection/ruby_class.rb', line 56

def name
  ast.children[0]
end

#to_ruby_strObject



68
69
70
# File 'lib/dissociated_introspection/ruby_class.rb', line 68

def to_ruby_str
  Unparser.unparse(ast)
end