Class: Worldline::Connect::SDK::V1::Domain::ShippingRiskAssessment

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#addressWorldline::Connect::SDK::V1::Domain::AddressPersonal

Returns the current value of address.

Returns:



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb', line 16

def address
  @address
end

#commentsString

Returns the current value of comments.

Returns:

  • (String)

    the current value of comments



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb', line 16

def comments
  @comments
end

#tracking_numberString

Returns the current value of tracking_number.

Returns:

  • (String)

    the current value of tracking_number



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb', line 16

def tracking_number
  @tracking_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'address'
    raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash
    @address = Worldline::Connect::SDK::V1::Domain::AddressPersonal.new_from_hash(hash['address'])
  end
  if hash.has_key? 'comments'
    @comments = hash['comments']
  end
  if hash.has_key? 'trackingNumber'
    @tracking_number = hash['trackingNumber']
  end
end

#to_hHash

Returns:

  • (Hash)


25
26
27
28
29
30
31
# File 'lib/worldline/connect/sdk/v1/domain/shipping_risk_assessment.rb', line 25

def to_h
  hash = super
  hash['address'] = @address.to_h unless @address.nil?
  hash['comments'] = @comments unless @comments.nil?
  hash['trackingNumber'] = @tracking_number unless @tracking_number.nil?
  hash
end