Class: Devlog::Sevendays

Inherits:
Object
  • Object
show all
Includes:
SevendaysTotal
Defined in:
lib/devlog.rb

Constant Summary collapse

DAYS =
%i(monday tuesday wednesday thursday friday saturday sunday).freeze
RANDOMDAY =
'Random'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SevendaysTotal

#total_hours, #total_hours_string

Constructor Details

#initialize(zezzions) ⇒ Sevendays

Returns a new instance of Sevendays.



401
402
403
# File 'lib/devlog.rb', line 401

def initialize(zezzions)
  @all = zezzions.sort
end

Instance Attribute Details

#allObject

Returns the value of attribute all.



395
396
397
# File 'lib/devlog.rb', line 395

def all
  @all
end

Instance Method Details

#begins_atObject



405
406
407
# File 'lib/devlog.rb', line 405

def begins_at
  all.first.zzbegin.strftime("%Y/%m/%d")
end

#dateObject



413
414
415
# File 'lib/devlog.rb', line 413

def date
  DateTime.current.strftime("%Y/%m/%d")
end

#ends_atObject



409
410
411
# File 'lib/devlog.rb', line 409

def ends_at
  all.last.zzend.strftime("%Y/%m/%d")
end