Class: YeshuaCrm::Liquid::CellsDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- YeshuaCrm::Liquid::CellsDrop
- Defined in:
- lib/yeshua_crm/liquid/drops/cells_drop.rb
Class Method Summary collapse
Instance Method Summary collapse
- #active ⇒ Object
- #all ⇒ Object
- #before_method(identifier) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(cells) ⇒ CellsDrop
constructor
A new instance of CellsDrop.
- #size ⇒ Object
Constructor Details
#initialize(cells) ⇒ CellsDrop
Returns a new instance of CellsDrop.
9 10 11 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 9 def initialize(cells) @cells = cells end |
Class Method Details
.default_drop ⇒ Object
5 6 7 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 5 def self.default_drop self.new Cell.visible.order(:name) end |
Instance Method Details
#active ⇒ Object
24 25 26 27 28 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 24 def active @active ||= @cells.select(&:active?).map do |cell| CellDrop.new cell end end |
#all ⇒ Object
18 19 20 21 22 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 18 def all @all ||= @cells.map do |cell| CellDrop.new cell end end |
#before_method(identifier) ⇒ Object
13 14 15 16 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 13 def before_method(identifier) cell = @cells.where(:identifier => identifier).first || Cell.new CellDrop.new cell end |
#each(&block) ⇒ Object
30 31 32 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 30 def each(&block) all.each(&block) end |
#size ⇒ Object
34 35 36 |
# File 'lib/yeshua_crm/liquid/drops/cells_drop.rb', line 34 def size @cells.size end |