Class: Vatlayer::Response::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/vatlayer/response/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Data

Returns a new instance of Data.



8
9
10
11
12
13
# File 'lib/vatlayer/response/data.rb', line 8

def initialize(attributes)
  attributes.each do |(key, value)|
    self.class.class_eval { attr_accessor :"#{key}" }
    public_send("#{key}=", key == 'error' ? Vatlayer::Response::Error.new(value) : value)
  end
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



6
7
8
# File 'lib/vatlayer/response/data.rb', line 6

def error
  @error
end