Class: ObjectInspector
- Inherits:
-
Object
- Object
- ObjectInspector
- Defined in:
- lib/object_inspector.rb
Instance Method Summary collapse
- #args_tree ⇒ Object
- #available_methods ⇒ Object
-
#initialize(obj) ⇒ ObjectInspector
constructor
A new instance of ObjectInspector.
- #response_map ⇒ Object
- #sample_call ⇒ Object
Constructor Details
#initialize(obj) ⇒ ObjectInspector
Returns a new instance of ObjectInspector.
5 6 7 |
# File 'lib/object_inspector.rb', line 5 def initialize(obj) @obj = obj end |
Instance Method Details
#args_tree ⇒ Object
13 14 15 |
# File 'lib/object_inspector.rb', line 13 def args_tree type_tree_for(@obj.class, {}, type_names) end |
#available_methods ⇒ Object
21 22 23 24 25 |
# File 'lib/object_inspector.rb', line 21 def available_methods @obj.constants.map { |c| c.to_s.split("_args").first if c.to_s.end_with?("_args") }.compact end |
#response_map ⇒ Object
17 18 19 |
# File 'lib/object_inspector.rb', line 17 def response_map response_tree(@obj, {}) end |
#sample_call ⇒ Object
9 10 11 |
# File 'lib/object_inspector.rb', line 9 def sample_call type_tree_for(@obj.class, {}, sample_values) end |