Class: Verizon::PlaceOfUse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/place_of_use.rb

Overview

The customer name and the address of the device’s primary place of use. Leave these fields empty to use the account profile address as the primary place of use. These values will be applied to all devices in the request.If the account is enabled for non-geographic MDNs and the device supports it, the primaryPlaceOfUse address will also be used to derive the MDN for the device.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(address = nil, customer_name = nil) ⇒ PlaceOfUse

Returns a new instance of PlaceOfUse.



44
45
46
47
# File 'lib/verizon/models/place_of_use.rb', line 44

def initialize(address = nil, customer_name = nil)
  @address = address
  @customer_name = customer_name
end

Instance Attribute Details

#addressAddress

The customer address for the line’s primary place of use, for line usage taxation.

Returns:



20
21
22
# File 'lib/verizon/models/place_of_use.rb', line 20

def address
  @address
end

#customer_nameCustomerName

The customer name to be used for line usage taxation.

Returns:



24
25
26
# File 'lib/verizon/models/place_of_use.rb', line 24

def customer_name
  @customer_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/verizon/models/place_of_use.rb', line 50

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address = Address.from_hash(hash['address']) if hash['address']
  customer_name = CustomerName.from_hash(hash['customerName']) if hash['customerName']

  # Create object from extracted values.
  PlaceOfUse.new(address,
                 customer_name)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
# File 'lib/verizon/models/place_of_use.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address'] = 'address'
  @_hash['customer_name'] = 'customerName'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
# File 'lib/verizon/models/place_of_use.rb', line 40

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
# File 'lib/verizon/models/place_of_use.rb', line 35

def self.optionals
  []
end