Class: DissociatedIntrospection::RubyClass::Def

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

Instance Method Summary collapse

Constructor Details

#initialize(ruby_code) ⇒ Def

Returns a new instance of Def.



5
6
7
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 5

def initialize(ruby_code)
  @ruby_code = ruby_code
end

Instance Method Details

#argumentsObject



13
14
15
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 13

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

#bodyObject



17
18
19
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 17

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

#nameObject



9
10
11
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 9

def name
  ruby_code.ast.children[0]
end

#to_ruby_strObject



21
22
23
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 21

def to_ruby_str
  ruby_code.to_ruby_str
end