Class: MiniObject::Inline
- Inherits:
-
Object
- Object
- MiniObject::Inline
- Includes:
- Injectable, RemarkableInspect
- Defined in:
- lib/mini_object/inline.rb
Constant Summary
Constants included from Injectable
Instance Attribute Summary collapse
-
#inline_name ⇒ Object
Returns the value of attribute inline_name.
Instance Method Summary collapse
-
#initialize(name = nil, args = {}, &block) ⇒ Inline
constructor
A new instance of Inline.
- #remarkable_methods ⇒ Object
- #remarkable_name ⇒ Object
Methods included from RemarkableInspect
Methods included from Injectable
#attr_injectable, #attributes=, #cattr_injectable, getsetter_definition_for, included, #let, setter_definition_for
Constructor Details
#initialize(name = nil, args = {}, &block) ⇒ Inline
Returns a new instance of Inline.
8 9 10 11 12 13 14 15 |
# File 'lib/mini_object/inline.rb', line 8 def initialize name = nil, args = {}, &block args.each do |k,v| define_singleton_method(k) { v } end @inline_name = name || 'inline' instance_exec self, &block if block end |
Instance Attribute Details
#inline_name ⇒ Object
Returns the value of attribute inline_name.
6 7 8 |
# File 'lib/mini_object/inline.rb', line 6 def inline_name @inline_name end |
Instance Method Details
#remarkable_methods ⇒ Object
17 18 19 |
# File 'lib/mini_object/inline.rb', line 17 def remarkable_methods (methods - self.class.instance_methods).sort end |
#remarkable_name ⇒ Object
21 22 23 |
# File 'lib/mini_object/inline.rb', line 21 def remarkable_name "#{inline_name || 'anon'} / Inline" end |