Class: Starling::Resources::AddressesResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/starling/resources/addresses_resource.rb

Overview

A resource representing a response from the Addresses API

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from Starling::Resources::BaseResource

Instance Method Details

#currentAddressResource


6
7
8
# File 'lib/starling/resources/addresses_resource.rb', line 6

def current
  AddressResource.new(parsed_data: parsed_data['current'])
end

#previousArray<AddressResource>


11
12
13
14
15
# File 'lib/starling/resources/addresses_resource.rb', line 11

def previous
  parsed_data['previous'].map do |address|
    AddressResource.new(parsed_data: address)
  end
end