Class: WebPay::ShopIdRequest

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 = {}) ⇒ ShopIdRequest

Returns a new instance of ShopIdRequest.



1767
1768
1769
1770
# File 'lib/webpay/data_types.rb', line 1767

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1748
1749
1750
# File 'lib/webpay/data_types.rb', line 1748

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
# File 'lib/webpay/data_types.rb', line 1755

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

.fieldsObject



1750
1751
1752
# File 'lib/webpay/data_types.rb', line 1750

def self.fields
  ['id']
end

Instance Method Details

#idObject

attributes accessors



1785
1786
1787
# File 'lib/webpay/data_types.rb', line 1785

def id
  attributes['id']
end

#id=(value) ⇒ Object



1789
1790
1791
# File 'lib/webpay/data_types.rb', line 1789

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

#query_paramsObject



1778
1779
1780
1781
# File 'lib/webpay/data_types.rb', line 1778

def query_params
  result = {}
  return result
end

#request_bodyObject



1773
1774
1775
1776
# File 'lib/webpay/data_types.rb', line 1773

def request_body
  result = {}
  result
end