Class: AteTracks::Structures::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, type) ⇒ Response

Returns a new instance of Response.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/atetracks/structures.rb', line 16

def initialize(data, type)
  class_type = Structures.const_get(type)
  if class_type
    @content = class_type.new(data[Helpers.underscore(type)])
    @status = data['status']
    @errors = data['errors']
    @notices = data['notices']
    @logged_in = data['logged_in']
    @api_version = data['api_version']
  end
end

Instance Attribute Details

#api_versionObject

Returns the value of attribute api_version.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def api_version
  @api_version
end

#contentObject

Returns the value of attribute content.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def content
  @content
end

#errorsObject

Returns the value of attribute errors.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def errors
  @errors
end

#logged_inObject

Returns the value of attribute logged_in.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def logged_in
  @logged_in
end

#noticesObject

Returns the value of attribute notices.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def notices
  @notices
end

#statusObject

Returns the value of attribute status.



14
15
16
# File 'lib/atetracks/structures.rb', line 14

def status
  @status
end