Class: I18n::Hygiene::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n/hygiene/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message: "") ⇒ Result

Returns a new instance of Result.



6
7
8
9
# File 'lib/i18n/hygiene/result.rb', line 6

def initialize(status, message: "")
  @status = status
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/i18n/hygiene/result.rb', line 4

def message
  @message
end

Instance Method Details

#passed?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
# File 'lib/i18n/hygiene/result.rb', line 11

def passed?
  case @status
  when :pass
    true
  when :failure
    false
  else
    raise "Unsupported status"
  end
end