Class: Desmoservice::Error

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Error.



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

def initialize(key, parameter = nil, value = nil)
  @key = key
  @parameter = parameter
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#parameterObject (readonly)

Returns the value of attribute parameter.



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

def parameter
  @parameter
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.from_json_hash(json_hash) ⇒ Object



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

def self.from_json_hash(json_hash)
  Error.new(json_hash['key'], json_hash['parameter'], json_hash['value'])
end