Class: Redmineup::Liquid::TimeEntriesDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Redmineup::Liquid::TimeEntriesDrop
- Defined in:
- lib/redmineup/liquid/drops/time_entries_drop.rb
Instance Method Summary collapse
- #all ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(time_entries) ⇒ TimeEntriesDrop
constructor
A new instance of TimeEntriesDrop.
- #size ⇒ Object
- #visible ⇒ Object
Constructor Details
#initialize(time_entries) ⇒ TimeEntriesDrop
Returns a new instance of TimeEntriesDrop.
4 5 6 |
# File 'lib/redmineup/liquid/drops/time_entries_drop.rb', line 4 def initialize(time_entries) @time_entries = time_entries end |
Instance Method Details
#all ⇒ Object
8 9 10 11 12 |
# File 'lib/redmineup/liquid/drops/time_entries_drop.rb', line 8 def all @all ||= @time_entries.map do |time_entry| TimeEntryDrop.new time_entry end end |
#each(&block) ⇒ Object
18 19 20 |
# File 'lib/redmineup/liquid/drops/time_entries_drop.rb', line 18 def each(&block) all.each(&block) end |
#size ⇒ Object
22 23 24 |
# File 'lib/redmineup/liquid/drops/time_entries_drop.rb', line 22 def size @time_entries.size end |
#visible ⇒ Object
14 15 16 |
# File 'lib/redmineup/liquid/drops/time_entries_drop.rb', line 14 def visible @visible ||= @all.select(&:visible?) end |