Class: WebPay::ShopRequestCreate

Inherits:
Entity
  • Object
show all
Defined in:
lib/webpay/data_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#normalize_hash, #to_h, #to_s

Constructor Details

#initialize(hash = {}) ⇒ ShopRequestCreate

Returns a new instance of ShopRequestCreate.



1653
1654
1655
1656
# File 'lib/webpay/data_types.rb', line 1653

def initialize(hash = {})
  hash = normalize_hash(hash)
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1636
1637
1638
# File 'lib/webpay/data_types.rb', line 1636

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1643
1644
1645
1646
1647
1648
1649
1650
1651
# File 'lib/webpay/data_types.rb', line 1643

def self.create(params)
  return params if params.is_a?(self)
  hash = case params
    when Hash; params
    else
      raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
    end
  self.new(hash)
end

.fieldsObject



1638
1639
1640
# File 'lib/webpay/data_types.rb', line 1638

def self.fields
  ['description', 'details']
end

Instance Method Details

#descriptionObject

attributes accessors



1673
1674
1675
# File 'lib/webpay/data_types.rb', line 1673

def description
  attributes['description']
end

#description=(value) ⇒ Object



1677
1678
1679
# File 'lib/webpay/data_types.rb', line 1677

def description=(value)
  attributes['description'] = value
end

#detailsObject



1681
1682
1683
# File 'lib/webpay/data_types.rb', line 1681

def details
  attributes['details']
end

#details=(value) ⇒ Object



1685
1686
1687
# File 'lib/webpay/data_types.rb', line 1685

def details=(value)
  attributes['details'] = value
end

#query_paramsObject



1666
1667
1668
1669
# File 'lib/webpay/data_types.rb', line 1666

def query_params
  result = {}
  return result
end

#request_bodyObject



1659
1660
1661
1662
1663
1664
# File 'lib/webpay/data_types.rb', line 1659

def request_body
  result = {}
  copy_if_exists(@attributes, result, 'description', 'request_body');
  copy_if_exists(@attributes, result, 'details', 'request_body');
  result
end