Class: Knish::DelegateInspector
- Inherits:
-
Struct
- Object
- Struct
- Knish::DelegateInspector
- Defined in:
- lib/knish/delegate_inspector.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
2 3 4 |
# File 'lib/knish/delegate_inspector.rb', line 2 def attributes @attributes end |
#object ⇒ Object
Returns the value of attribute object
2 3 4 |
# File 'lib/knish/delegate_inspector.rb', line 2 def object @object end |
Instance Method Details
#mapped_attributes ⇒ Object
11 12 13 14 15 |
# File 'lib/knish/delegate_inspector.rb', line 11 def mapped_attributes attributes.map do |attr| "@#{attr}=#{object.send(attr).inspect}" end end |
#memory_location ⇒ Object
7 8 9 |
# File 'lib/knish/delegate_inspector.rb', line 7 def memory_location '0x00%x' % (object.object_id << 1) end |
#to_inspect ⇒ Object
3 4 5 |
# File 'lib/knish/delegate_inspector.rb', line 3 def to_inspect "#<#{object.class.name}:#{memory_location} #{mapped_attributes.join(' ')}>" end |