Class: Calorie::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/calorie.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



16
17
18
# File 'lib/calorie.rb', line 16

def initialize
  week_starts_on :sunday
end

Instance Method Details

#week_starts_on(day = nil) ⇒ Object



20
21
22
23
# File 'lib/calorie.rb', line 20

def week_starts_on(day = nil)
  @week_starts_on = day if day
  @week_starts_on
end

#week_starts_on?(day) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/calorie.rb', line 25

def week_starts_on?(day)
  day == @week_starts_on
end