Class: AutoObject

Inherits:
Object show all
Includes:
BlankSlate, Verbosify
Defined in:
lib/auto_object.rb

Instance Attribute Summary

Attributes included from Verbosify

#verbose_object_options, #verbose_object_reference

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Verbosify

#method_missing, #verbose_object?, #verbose_object_method_missing, #verbose_object_trace

Methods included from BlankSlate

#blank_slate?, extended, included

Constructor Details

#initialize(opts = nil) ⇒ AutoObject

Returns a new instance of AutoObject.



18
19
20
# File 'lib/auto_object.rb', line 18

def initialize ( opts=nil )
  super(:auto_object, opts)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Verbosify

Class Method Details

.blank_slate_ignore(name) ⇒ Object



11
12
13
# File 'lib/auto_object.rb', line 11

def self.blank_slate_ignore ( name )
  VerboseObject.blank_slate_ignore(name)
end

Instance Method Details

#auto_object?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/auto_object.rb', line 39

def auto_object?
  true
end

#inspectObject



22
23
24
# File 'lib/auto_object.rb', line 22

def inspect
  "#<#{__blank_slate_class}: #{verbose_object_trace(:inspect)}>"
end

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
46
# File 'lib/auto_object.rb', line 43

def respond_to? ( meth )
  method_missing(:respond_to?, meth)
  meth != :to_ary
end

#to_sObject Also known as: to_str



26
27
28
# File 'lib/auto_object.rb', line 26

def to_s
  verbose_object_trace(:to_s)
end

#verbose_object_empty_trace(action = nil) ⇒ Object



31
32
33
# File 'lib/auto_object.rb', line 31

def verbose_object_empty_trace ( action=nil )
  (action == :inspect)? "new" : "#{__blank_slate_class}.new"
end

#verbose_object_send(m, *a, &b) ⇒ Object



35
36
37
# File 'lib/auto_object.rb', line 35

def verbose_object_send ( m, *a, &b )
  __blank_slate_class.new
end