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.
5
6
7
8
9
10
11
|
# File 'lib/liquid/tablerowloop_drop.rb', line 5
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.
13
14
15
|
# File 'lib/liquid/tablerowloop_drop.rb', line 13
def col
@col
end
|
#length ⇒ Object
Returns the value of attribute length.
13
14
15
|
# File 'lib/liquid/tablerowloop_drop.rb', line 13
def length
@length
end
|
#row ⇒ Object
Returns the value of attribute row.
13
14
15
|
# File 'lib/liquid/tablerowloop_drop.rb', line 13
def row
@row
end
|
Instance Method Details
#col0 ⇒ Object
23
24
25
|
# File 'lib/liquid/tablerowloop_drop.rb', line 23
def col0
@col - 1
end
|
#col_first ⇒ Object
43
44
45
|
# File 'lib/liquid/tablerowloop_drop.rb', line 43
def col_first
@col == 1
end
|
#col_last ⇒ Object
47
48
49
|
# File 'lib/liquid/tablerowloop_drop.rb', line 47
def col_last
@col == @cols
end
|
#first ⇒ Object
35
36
37
|
# File 'lib/liquid/tablerowloop_drop.rb', line 35
def first
@index == 0
end
|
#index ⇒ Object
15
16
17
|
# File 'lib/liquid/tablerowloop_drop.rb', line 15
def index
@index + 1
end
|
#index0 ⇒ Object
19
20
21
|
# File 'lib/liquid/tablerowloop_drop.rb', line 19
def index0
@index
end
|
#last ⇒ Object
39
40
41
|
# File 'lib/liquid/tablerowloop_drop.rb', line 39
def last
@index == @length - 1
end
|
#rindex ⇒ Object
27
28
29
|
# File 'lib/liquid/tablerowloop_drop.rb', line 27
def rindex
@length - @index
end
|
#rindex0 ⇒ Object
31
32
33
|
# File 'lib/liquid/tablerowloop_drop.rb', line 31
def rindex0
@length - @index - 1
end
|