Class: DissociatedIntrospection::RubyClass::Def
- Inherits:
-
Object
- Object
- DissociatedIntrospection::RubyClass::Def
- Defined in:
- lib/dissociated_introspection/ruby_class/def.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #body ⇒ Object
-
#initialize(ruby_code) ⇒ Def
constructor
A new instance of Def.
- #name ⇒ Object
- #to_ruby_str ⇒ Object
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
#arguments ⇒ Object
13 14 15 |
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 13 def arguments Unparser.unparse(ruby_code.ast.children[1]) end |
#body ⇒ Object
17 18 19 |
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 17 def body Unparser.unparse(ruby_code.ast.children[2]) end |
#name ⇒ Object
9 10 11 |
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 9 def name ruby_code.ast.children[0] end |
#to_ruby_str ⇒ Object
21 22 23 |
# File 'lib/dissociated_introspection/ruby_class/def.rb', line 21 def to_ruby_str ruby_code.to_ruby_str end |