Class: Nazar::Formatter::SequelItem

Inherits:
Object
  • Object
show all
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

Methods included from SequelInterface

#cells, #headers, #valid?

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

Returns:

  • (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

#summaryObject



20
21
22
# File 'lib/nazar/formatter/sequel_item.rb', line 20

def summary
  false
end