Class: OnlinePayments::SDK::Domain::ShippingMethod

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/shipping_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#detailsString

Returns the current value of details.

Returns:

  • (String)

    the current value of details



13
14
15
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 13

def details
  @details
end

#nameString

Returns the current value of name.

Returns:

  • (String)

    the current value of name



13
14
15
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 13

def name
  @name
end

#speedInteger

Returns the current value of speed.

Returns:

  • (Integer)

    the current value of speed



13
14
15
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 13

def speed
  @speed
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



13
14
15
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 13

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'details'
    @details = hash['details']
  end
  if hash.has_key? 'name'
    @name = hash['name']
  end
  if hash.has_key? 'speed'
    @speed = hash['speed']
  end
  if hash.has_key? 'type'
    @type = hash['type']
  end
end

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
31
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 24

def to_h
  hash = super
  hash['details'] = @details unless @details.nil?
  hash['name'] = @name unless @name.nil?
  hash['speed'] = @speed unless @speed.nil?
  hash['type'] = @type unless @type.nil?
  hash
end