Class: PaymentDay::Views
- Inherits:
-
Object
- Object
- PaymentDay::Views
- Defined in:
- lib/payment_day.rb
Instance Attribute Summary collapse
-
#views ⇒ Object
readonly
Returns the value of attribute views.
Instance Method Summary collapse
-
#initialize(views, options) ⇒ Views
constructor
A new instance of Views.
- #print ⇒ Object
Constructor Details
#initialize(views, options) ⇒ Views
Returns a new instance of Views.
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/payment_day.rb', line 130 def initialize(views, ) @views = [] years = View.create(views, ).years years = years.each_slice([:columns]) years.each_with_index do |years_chunk, page| = .dup [:page] = page.next [:pages] = years.to_a.length @views.push(View.create(years_chunk, )) end end |
Instance Attribute Details
#views ⇒ Object (readonly)
Returns the value of attribute views.
128 129 130 |
# File 'lib/payment_day.rb', line 128 def views @views end |
Instance Method Details
#print ⇒ Object
142 143 144 |
# File 'lib/payment_day.rb', line 142 def print @views.each { |view| puts view.list } end |