Class: Nazar::Formatter::ActiveRecordItem
- Inherits:
-
Object
- Object
- Nazar::Formatter::ActiveRecordItem
- Includes:
- ActiveRecordInterface
- Defined in:
- lib/nazar/formatter/active_record_item.rb
Instance Attribute Summary
Attributes included from ActiveRecordInterface
#attributes, #collection, #klass
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(item) ⇒ ActiveRecordItem
constructor
A new instance of ActiveRecordItem.
- #summary ⇒ Object
Methods included from ActiveRecordInterface
Constructor Details
#initialize(item) ⇒ ActiveRecordItem
Returns a new instance of ActiveRecordItem.
10 11 12 13 14 |
# File 'lib/nazar/formatter/active_record_item.rb', line 10 def initialize(item) @collection = [item] @attributes = item.attributes @klass = item.class end |
Class Method Details
.valid?(data) ⇒ Boolean
16 17 18 |
# File 'lib/nazar/formatter/active_record_item.rb', line 16 def self.valid?(data) data.is_a?(ActiveRecord::Base) end |
Instance Method Details
#summary ⇒ Object
20 21 22 |
# File 'lib/nazar/formatter/active_record_item.rb', line 20 def summary false end |