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.
3
4
5
6
7
8
9
|
# File 'lib/liquid/tablerowloop_drop.rb', line 3
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.
11
12
13
|
# File 'lib/liquid/tablerowloop_drop.rb', line 11
def col
@col
end
|
#length ⇒ Object
Returns the value of attribute length.
11
12
13
|
# File 'lib/liquid/tablerowloop_drop.rb', line 11
def length
@length
end
|
#row ⇒ Object
Returns the value of attribute row.
11
12
13
|
# File 'lib/liquid/tablerowloop_drop.rb', line 11
def row
@row
end
|
Instance Method Details
#col0 ⇒ Object
21
22
23
|
# File 'lib/liquid/tablerowloop_drop.rb', line 21
def col0
@col - 1
end
|
#col_first ⇒ Object
41
42
43
|
# File 'lib/liquid/tablerowloop_drop.rb', line 41
def col_first
@col == 1
end
|
#col_last ⇒ Object
45
46
47
|
# File 'lib/liquid/tablerowloop_drop.rb', line 45
def col_last
@col == @cols
end
|
#first ⇒ Object
33
34
35
|
# File 'lib/liquid/tablerowloop_drop.rb', line 33
def first
@index == 0
end
|
#index ⇒ Object
13
14
15
|
# File 'lib/liquid/tablerowloop_drop.rb', line 13
def index
@index + 1
end
|
#index0 ⇒ Object
17
18
19
|
# File 'lib/liquid/tablerowloop_drop.rb', line 17
def index0
@index
end
|
#last ⇒ Object
37
38
39
|
# File 'lib/liquid/tablerowloop_drop.rb', line 37
def last
@index == @length - 1
end
|
#rindex ⇒ Object
25
26
27
|
# File 'lib/liquid/tablerowloop_drop.rb', line 25
def rindex
@length - @index
end
|
#rindex0 ⇒ Object
29
30
31
|
# File 'lib/liquid/tablerowloop_drop.rb', line 29
def rindex0
@length - @index - 1
end
|