Class: WebPay::ShopRequestAlterStatus

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

Returns a new instance of ShopRequestAlterStatus.



1814
1815
1816
1817
# File 'lib/webpay/data_types.rb', line 1814

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1795
1796
1797
# File 'lib/webpay/data_types.rb', line 1795

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
# File 'lib/webpay/data_types.rb', line 1802

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



1797
1798
1799
# File 'lib/webpay/data_types.rb', line 1797

def self.fields
  ['id', 'status']
end

Instance Method Details

#idObject

attributes accessors



1833
1834
1835
# File 'lib/webpay/data_types.rb', line 1833

def id
  attributes['id']
end

#id=(value) ⇒ Object



1837
1838
1839
# File 'lib/webpay/data_types.rb', line 1837

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

#query_paramsObject



1826
1827
1828
1829
# File 'lib/webpay/data_types.rb', line 1826

def query_params
  result = {}
  return result
end

#request_bodyObject



1820
1821
1822
1823
1824
# File 'lib/webpay/data_types.rb', line 1820

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

#statusObject



1841
1842
1843
# File 'lib/webpay/data_types.rb', line 1841

def status
  attributes['status']
end

#status=(value) ⇒ Object



1845
1846
1847
# File 'lib/webpay/data_types.rb', line 1845

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