Class: WebPay::ChargeListRequest

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



693
694
695
696
697
# File 'lib/webpay/data_types.rb', line 693

def initialize(hash = {})
  hash = normalize_hash(hash)
  hash['created'] = hash['created'].is_a?(Hash) ? WebPay::CreatedRange.new(hash['created']) : hash['created']
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



676
677
678
# File 'lib/webpay/data_types.rb', line 676

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



683
684
685
686
687
688
689
690
691
# File 'lib/webpay/data_types.rb', line 683

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



678
679
680
# File 'lib/webpay/data_types.rb', line 678

def self.fields
  ['count', 'offset', 'created', 'customer', 'recursion', 'shop']
end

Instance Method Details

#countObject

attributes accessors



718
719
720
# File 'lib/webpay/data_types.rb', line 718

def count
  attributes['count']
end

#count=(value) ⇒ Object



722
723
724
# File 'lib/webpay/data_types.rb', line 722

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

#createdObject



734
735
736
# File 'lib/webpay/data_types.rb', line 734

def created
  attributes['created']
end

#created=(value) ⇒ Object



738
739
740
741
# File 'lib/webpay/data_types.rb', line 738

def created=(value)
  value = value.is_a?(Hash) ? WebPay::CreatedRange.new(value) : value
  attributes['created'] = value
end

#customerObject



743
744
745
# File 'lib/webpay/data_types.rb', line 743

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



747
748
749
# File 'lib/webpay/data_types.rb', line 747

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

#offsetObject



726
727
728
# File 'lib/webpay/data_types.rb', line 726

def offset
  attributes['offset']
end

#offset=(value) ⇒ Object



730
731
732
# File 'lib/webpay/data_types.rb', line 730

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

#query_paramsObject



705
706
707
708
709
710
711
712
713
714
# File 'lib/webpay/data_types.rb', line 705

def query_params
  result = {}
  copy_if_exists(@attributes, result, 'count', 'query_params');
  copy_if_exists(@attributes, result, 'offset', 'query_params');
  copy_if_exists(@attributes, result, 'created', 'query_params');
  copy_if_exists(@attributes, result, 'customer', 'query_params');
  copy_if_exists(@attributes, result, 'recursion', 'query_params');
  copy_if_exists(@attributes, result, 'shop', 'query_params');
  return result
end

#recursionObject



751
752
753
# File 'lib/webpay/data_types.rb', line 751

def recursion
  attributes['recursion']
end

#recursion=(value) ⇒ Object



755
756
757
# File 'lib/webpay/data_types.rb', line 755

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

#request_bodyObject



700
701
702
703
# File 'lib/webpay/data_types.rb', line 700

def request_body
  result = {}
  result
end

#shopObject



759
760
761
# File 'lib/webpay/data_types.rb', line 759

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



763
764
765
# File 'lib/webpay/data_types.rb', line 763

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