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

Returns a new instance of ChargeListRequest.



628
629
630
631
632
# File 'lib/webpay/data_types.rb', line 628

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.



611
612
613
# File 'lib/webpay/data_types.rb', line 611

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



618
619
620
621
622
623
624
625
626
# File 'lib/webpay/data_types.rb', line 618

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



613
614
615
# File 'lib/webpay/data_types.rb', line 613

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

Instance Method Details

#countObject

attributes accessors



653
654
655
# File 'lib/webpay/data_types.rb', line 653

def count
  attributes['count']
end

#count=(value) ⇒ Object



657
658
659
# File 'lib/webpay/data_types.rb', line 657

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

#createdObject



669
670
671
# File 'lib/webpay/data_types.rb', line 669

def created
  attributes['created']
end

#created=(value) ⇒ Object



673
674
675
676
# File 'lib/webpay/data_types.rb', line 673

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

#customerObject



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

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



682
683
684
# File 'lib/webpay/data_types.rb', line 682

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

#offsetObject



661
662
663
# File 'lib/webpay/data_types.rb', line 661

def offset
  attributes['offset']
end

#offset=(value) ⇒ Object



665
666
667
# File 'lib/webpay/data_types.rb', line 665

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

#query_paramsObject



640
641
642
643
644
645
646
647
648
649
# File 'lib/webpay/data_types.rb', line 640

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



686
687
688
# File 'lib/webpay/data_types.rb', line 686

def recursion
  attributes['recursion']
end

#recursion=(value) ⇒ Object



690
691
692
# File 'lib/webpay/data_types.rb', line 690

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

#request_bodyObject



635
636
637
638
# File 'lib/webpay/data_types.rb', line 635

def request_body
  result = {}
  result
end

#shopObject



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

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



698
699
700
# File 'lib/webpay/data_types.rb', line 698

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