Class: CounterAdapter
- Inherits:
-
DataMapper::Adapters::AbstractAdapter
- Object
- DataMapper::Adapters::AbstractAdapter
- CounterAdapter
- Defined in:
- lib/dm-core/spec/lib/counter_adapter.rb
Instance Attribute Summary collapse
-
#counts ⇒ Object
readonly
Returns the value of attribute counts.
Attributes inherited from DataMapper::Adapters::AbstractAdapter
#field_naming_convention, #name, #options, #resource_naming_convention
Instance Method Summary collapse
- #instance_of?(klass) ⇒ Boolean
- #kind_of?(klass) ⇒ Boolean
- #respond_to?(method, include_private = false) ⇒ Boolean
Methods inherited from DataMapper::Adapters::AbstractAdapter
#attributes_as_fields, #create, #delete, descendants, inherited, #initialize_serial, #new_query, #read, #update
Methods included from DataMapper::Assertions
Methods included from DataMapper::Equalizer
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
34 35 36 37 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 34 def method_missing(method, *args, &block) increment_count_for(method) @adapter.send(method, *args, &block) end |
Instance Attribute Details
#counts ⇒ Object (readonly)
Returns the value of attribute counts.
8 9 10 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 8 def counts @counts end |
Instance Method Details
#instance_of?(klass) ⇒ Boolean
14 15 16 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 14 def instance_of?(klass) super || @adapter.instance_of?(klass) end |
#kind_of?(klass) ⇒ Boolean
10 11 12 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 10 def kind_of?(klass) super || @adapter.kind_of?(klass) end |
#respond_to?(method, include_private = false) ⇒ Boolean
18 19 20 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 18 def respond_to?(method, include_private = false) super || @adapter.respond_to?(method, include_private) end |