Class: Liquid::TablerowloopDrop
- Inherits:
-
Drop
- Object
- Drop
- Liquid::TablerowloopDrop
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
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
#col ⇒ Object
Returns the value of attribute col.
28
29
30
|
# File 'lib/liquid/tablerowloop_drop.rb', line 28
def col
@col
end
|
#length ⇒ Object
Returns the value of attribute length.
22
23
24
|
# File 'lib/liquid/tablerowloop_drop.rb', line 22
def length
@length
end
|
#row ⇒ Object
Returns the value of attribute row.
34
35
36
|
# File 'lib/liquid/tablerowloop_drop.rb', line 34
def row
@row
end
|
Instance Method Details
#col0 ⇒ Object
56
57
58
|
# File 'lib/liquid/tablerowloop_drop.rb', line 56
def col0
@col - 1
end
|
#col_first ⇒ Object
96
97
98
|
# File 'lib/liquid/tablerowloop_drop.rb', line 96
def col_first
@col == 1
end
|
#col_last ⇒ Object
104
105
106
|
# File 'lib/liquid/tablerowloop_drop.rb', line 104
def col_last
@col == @cols
end
|
#first ⇒ Object
80
81
82
|
# File 'lib/liquid/tablerowloop_drop.rb', line 80
def first
@index == 0
end
|
#index ⇒ Object
40
41
42
|
# File 'lib/liquid/tablerowloop_drop.rb', line 40
def index
@index + 1
end
|
#index0 ⇒ Object
48
49
50
|
# File 'lib/liquid/tablerowloop_drop.rb', line 48
def index0
@index
end
|
#last ⇒ Object
88
89
90
|
# File 'lib/liquid/tablerowloop_drop.rb', line 88
def last
@index == @length - 1
end
|
#rindex ⇒ Object
64
65
66
|
# File 'lib/liquid/tablerowloop_drop.rb', line 64
def rindex
@length - @index
end
|
#rindex0 ⇒ Object
72
73
74
|
# File 'lib/liquid/tablerowloop_drop.rb', line 72
def rindex0
@length - @index - 1
end
|