Exception: SkiBinding::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ski_binding_calculator/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(key = nil, value = nil) ⇒ Error

Returns a new instance of Error.



2
3
4
5
6
7
8
# File 'lib/ski_binding_calculator/error.rb', line 2

def initialize(key = nil, value = nil)
  @messages = {}
  
  if !key.nil? && !value.nil?
    @messages[key] = value
  end
end

Instance Method Details

#add_message(key, value) ⇒ Object



14
15
16
# File 'lib/ski_binding_calculator/error.rb', line 14

def add_message(key, value)
  @messages[key] = value
end

#messagesObject



10
11
12
# File 'lib/ski_binding_calculator/error.rb', line 10

def messages
  @messages
end