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.



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

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

Instance Attribute Details

#allObject

Returns the value of attribute all.



389
390
391
# File 'lib/devlog.rb', line 389

def all
  @all
end

Instance Method Details

#begins_atObject



399
400
401
# File 'lib/devlog.rb', line 399

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

#dateObject



407
408
409
# File 'lib/devlog.rb', line 407

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

#ends_atObject



403
404
405
# File 'lib/devlog.rb', line 403

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