class FeastFast::Fast
Attributes
status[R]
text[R]
Public Class Methods
new(hsh={:status => STATUS::NO, :text => nil})
click to toggle source
# File lib/feast_fast/fast.rb, line 14 def initialize(hsh={:status => STATUS::NO, :text => nil}) @status = hsh[:status] @text = get_text(hsh[:text]) end
Public Instance Methods
==(fast)
click to toggle source
# File lib/feast_fast/fast.rb, line 23 def == fast self.status == fast.status && self.text == fast.text end
to_s()
click to toggle source
# File lib/feast_fast/fast.rb, line 19 def to_s @text end
Private Instance Methods
get_text(hsh_text)
click to toggle source
# File lib/feast_fast/fast.rb, line 29 def get_text(hsh_text) text = case @status when STATUS::LOOSE "Пища без мяса" when STATUS::COMMON "Постный день" when STATUS::STRICT "Строгий пост" when STATUS::NO "Нет поста" end text = "#{hsh_text.chomp('.')}. #{text}" if hsh_text text end