Class: G5FoundationClient::Location

Inherits:
Object
  • Object
show all
Extended by:
FindableByUid
Defined in:
lib/g5_foundation_client/models/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FindableByUid

find_by_uid

Constructor Details

#initialize(attrs) ⇒ Location

Returns a new instance of Location.



6
7
8
9
# File 'lib/g5_foundation_client/models/location.rb', line 6

def initialize(attrs)
  self.client        = attrs.delete(:client) || attrs.delete('client')
  self.location_hash = ActiveSupport::HashWithIndifferentAccess.new attrs.fetch(:location, attrs)
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/g5_foundation_client/models/location.rb', line 4

def client
  @client
end

#location_hashObject

Returns the value of attribute location_hash.



4
5
6
# File 'lib/g5_foundation_client/models/location.rb', line 4

def location_hash
  @location_hash
end

Instance Method Details

#street_addressObject



44
45
46
47
# File 'lib/g5_foundation_client/models/location.rb', line 44

def street_address
  return street_address_1 if street_address_2.blank?
  "#{street_address_1}\n#{street_address_2}"
end