Class: Liquid::TablerowloopDrop

Inherits:
Drop
  • Object
show all
Defined in:
lib/liquid/tablerowloop_drop.rb

Instance Attribute Summary collapse

Attributes inherited from Drop

#context

Instance Method Summary collapse

Methods inherited from Drop

#inspect, invokable?, invokable_methods, #invoke_drop, #key?, #liquid_method_missing, #to_liquid, #to_s

Constructor Details

#initialize(length, cols) ⇒ TablerowloopDrop

Returns a new instance of TablerowloopDrop.



10
11
12
13
14
15
16
# File 'lib/liquid/tablerowloop_drop.rb', line 10

def initialize(length, cols)
  @length = length
  @row    = 1
  @col    = 1
  @cols   = cols
  @index  = 0
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



28
29
30
# File 'lib/liquid/tablerowloop_drop.rb', line 28

def col
  @col
end

#lengthObject (readonly)

Returns the value of attribute length.



22
23
24
# File 'lib/liquid/tablerowloop_drop.rb', line 22

def length
  @length
end

#rowObject (readonly)

Returns the value of attribute row.



34
35
36
# File 'lib/liquid/tablerowloop_drop.rb', line 34

def row
  @row
end

Instance Method Details

#col0Object



56
57
58
# File 'lib/liquid/tablerowloop_drop.rb', line 56

def col0
  @col - 1
end

#col_firstObject



96
97
98
# File 'lib/liquid/tablerowloop_drop.rb', line 96

def col_first
  @col == 1
end

#col_lastObject



104
105
106
# File 'lib/liquid/tablerowloop_drop.rb', line 104

def col_last
  @col == @cols
end

#firstObject



80
81
82
# File 'lib/liquid/tablerowloop_drop.rb', line 80

def first
  @index == 0
end

#indexObject



40
41
42
# File 'lib/liquid/tablerowloop_drop.rb', line 40

def index
  @index + 1
end

#index0Object



48
49
50
# File 'lib/liquid/tablerowloop_drop.rb', line 48

def index0
  @index
end

#lastObject



88
89
90
# File 'lib/liquid/tablerowloop_drop.rb', line 88

def last
  @index == @length - 1
end

#rindexObject



64
65
66
# File 'lib/liquid/tablerowloop_drop.rb', line 64

def rindex
  @length - @index
end

#rindex0Object



72
73
74
# File 'lib/liquid/tablerowloop_drop.rb', line 72

def rindex0
  @length - @index - 1
end