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

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/shipping_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::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



29
30
31
32
33
34
35
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 29

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

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/shipping_method.rb', line 20

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