Class: AutoObject

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

Overview

Copyright

Copyright © 2005 Nicolas Pouillard. All rights reserved.

Author

Nicolas Pouillard <[email protected]>.

License

Gnu General Public License.

Revision

$Id: /w/fey/ruby_ex/trunk/lib/auto_object.rb 21865 2006-02-18T17:13:28.680350Z pouillar $

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.



15
16
17
# File 'lib/auto_object.rb', line 15

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



8
9
10
# File 'lib/auto_object.rb', line 8

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

Instance Method Details

#auto_object?Boolean

Returns:

  • (Boolean)


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

def auto_object?
  true
end

#inspectObject



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

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

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#to_sObject Also known as: to_str



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

def to_s
  verbose_object_trace(:to_s)
end

#verbose_object_empty_trace(action = nil) ⇒ Object



28
29
30
# File 'lib/auto_object.rb', line 28

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

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



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

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