Exception: Distimo::Error

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, note, link) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
# File 'lib/distimo/error.rb', line 5

def initialize code,note,link
   @code = code
   @note = note
   @link = link
   super("Code: #{code}. #{note} See: #{link}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/distimo/error.rb', line 3

def code
  @code
end

Returns the value of attribute link.



3
4
5
# File 'lib/distimo/error.rb', line 3

def link
  @link
end

#noteObject (readonly)

Returns the value of attribute note.



3
4
5
# File 'lib/distimo/error.rb', line 3

def note
  @note
end

Class Method Details

.from_response(response) ⇒ Object



12
13
14
# File 'lib/distimo/error.rb', line 12

def self.from_response response
  new(response["code"],response["message"],response["link"])
end