Class: HttpObservatory::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/http_observatory/models/base.rb

Overview

Base Class for API objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/http_observatory/models/base.rb', line 9

def initialize(args = {})
  args.each do |name, value|
    attr_name = name.to_s.downcase.underscore
    send("#{attr_name}=", value) if respond_to?("#{attr_name}=")
  end
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



7
8
9
# File 'lib/http_observatory/models/base.rb', line 7

def errors
  @errors
end