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.



1898
1899
1900
1901
# File 'lib/webpay/data_types.rb', line 1898

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1879
1880
1881
# File 'lib/webpay/data_types.rb', line 1879

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
# File 'lib/webpay/data_types.rb', line 1886

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



1881
1882
1883
# File 'lib/webpay/data_types.rb', line 1881

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

Instance Method Details

#idObject

attributes accessors



1917
1918
1919
# File 'lib/webpay/data_types.rb', line 1917

def id
  attributes['id']
end

#id=(value) ⇒ Object



1921
1922
1923
# File 'lib/webpay/data_types.rb', line 1921

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

#query_paramsObject



1910
1911
1912
1913
# File 'lib/webpay/data_types.rb', line 1910

def query_params
  result = {}
  return result
end

#request_bodyObject



1904
1905
1906
1907
1908
# File 'lib/webpay/data_types.rb', line 1904

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

#statusObject



1925
1926
1927
# File 'lib/webpay/data_types.rb', line 1925

def status
  attributes['status']
end

#status=(value) ⇒ Object



1929
1930
1931
# File 'lib/webpay/data_types.rb', line 1929

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