Class: Masklen::BatchItemError

Inherits:
Struct
  • Object
show all
Defined in:
lib/masklen/types.rb

Overview

Represents a failed entry inside a batch lookup response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#error_codeObject

Returns the value of attribute error_code

Returns:

  • (Object)

    the current value of error_code



122
123
124
# File 'lib/masklen/types.rb', line 122

def error_code
  @error_code
end

#error_messageObject

Returns the value of attribute error_message

Returns:

  • (Object)

    the current value of error_message



122
123
124
# File 'lib/masklen/types.rb', line 122

def error_message
  @error_message
end

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip



122
123
124
# File 'lib/masklen/types.rb', line 122

def ip
  @ip
end

Class Method Details

.from_hash(hash) ⇒ Object

Build a BatchItemError from a parsed JSON hash.



129
130
131
132
133
134
135
# File 'lib/masklen/types.rb', line 129

def self.from_hash(hash)
  new(
    ip:            hash["ip"],
    error_code:    hash["error_code"],
    error_message: hash["error_message"]
  )
end