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)
-
- (Object) counts
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)
- - (Boolean) instance_of?(klass)
- - (Boolean) kind_of?(klass)
- - (Boolean) respond_to?(method, include_private = false)
Methods inherited from DataMapper::Adapters::AbstractAdapter
#attributes_as_fields, #create, #delete, descendants, inherited, #initialize_serial, #new_query, #read, #update
Methods included from DataMapper::Equalizer
Methods included from DataMapper::Assertions
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args, &block) (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
- (Object) counts (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
- (Boolean) instance_of?(klass)
14 15 16 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 14 def instance_of?(klass) super || @adapter.instance_of?(klass) end |
- (Boolean) kind_of?(klass)
10 11 12 |
# File 'lib/dm-core/spec/lib/counter_adapter.rb', line 10 def kind_of?(klass) super || @adapter.kind_of?(klass) end |
- (Boolean) respond_to?(method, include_private = false)
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 |