Class: MiniObject::Inline

Inherits:
Object
  • Object
show all
Includes:
Injectable, RemarkableInspect
Defined in:
lib/mini_object/inline.rb

Constant Summary

Constants included from Injectable

MiniObject::Injectable::NULL

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RemarkableInspect

included, #to_s

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_nameObject

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_methodsObject



17
18
19
# File 'lib/mini_object/inline.rb', line 17

def remarkable_methods
  (methods - self.class.instance_methods).sort
end

#remarkable_nameObject



21
22
23
# File 'lib/mini_object/inline.rb', line 21

def remarkable_name
  "#{inline_name || 'anon'} / Inline"
end