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