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.



1588
1589
1590
1591
# File 'lib/webpay/data_types.rb', line 1588

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1571
1572
1573
# File 'lib/webpay/data_types.rb', line 1571

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1578
1579
1580
1581
1582
1583
1584
1585
1586
# File 'lib/webpay/data_types.rb', line 1578

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



1573
1574
1575
# File 'lib/webpay/data_types.rb', line 1573

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

Instance Method Details

#descriptionObject

attributes accessors



1608
1609
1610
# File 'lib/webpay/data_types.rb', line 1608

def description
  attributes['description']
end

#description=(value) ⇒ Object



1612
1613
1614
# File 'lib/webpay/data_types.rb', line 1612

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

#detailsObject



1616
1617
1618
# File 'lib/webpay/data_types.rb', line 1616

def details
  attributes['details']
end

#details=(value) ⇒ Object



1620
1621
1622
# File 'lib/webpay/data_types.rb', line 1620

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

#query_paramsObject



1601
1602
1603
1604
# File 'lib/webpay/data_types.rb', line 1601

def query_params
  result = {}
  return result
end

#request_bodyObject



1594
1595
1596
1597
1598
1599
# File 'lib/webpay/data_types.rb', line 1594

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