Class: FeastFast::Feast

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

Defined Under Namespace

Modules: STATUS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {:status => 0, :text => "No feast today"}) ⇒ Feast

Returns a new instance of Feast.



14
15
16
17
# File 'lib/feast_fast/feast.rb', line 14

def initialize(hsh={:status => 0, :text => "No feast today"})
  @status = hsh[:status]
  @text = hsh[:text]
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/feast_fast/feast.rb', line 12

def status
  @status
end

#textObject (readonly)

Returns the value of attribute text.



12
13
14
# File 'lib/feast_fast/feast.rb', line 12

def text
  @text
end

Instance Method Details

#to_sObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/feast_fast/feast.rb', line 19

def to_s
  @text + case @status
    when STATUS::GREAT
      ". (великий)"
    when STATUS::TWELVE
      ". (двунадесятый)"
    else
      ""
  end
end