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.



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

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.



603
604
605
# File 'lib/webpay/data_types.rb', line 603

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



610
611
612
613
614
615
616
617
618
# File 'lib/webpay/data_types.rb', line 610

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



605
606
607
# File 'lib/webpay/data_types.rb', line 605

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

Instance Method Details

#capturedObject



696
697
698
# File 'lib/webpay/data_types.rb', line 696

def captured
  attributes['captured']
end

#captured=(value) ⇒ Object



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

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

#countObject

attributes accessors



647
648
649
# File 'lib/webpay/data_types.rb', line 647

def count
  attributes['count']
end

#count=(value) ⇒ Object



651
652
653
# File 'lib/webpay/data_types.rb', line 651

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

#createdObject



663
664
665
# File 'lib/webpay/data_types.rb', line 663

def created
  attributes['created']
end

#created=(value) ⇒ Object



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

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

#customerObject



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

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



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

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

#offsetObject



655
656
657
# File 'lib/webpay/data_types.rb', line 655

def offset
  attributes['offset']
end

#offset=(value) ⇒ Object



659
660
661
# File 'lib/webpay/data_types.rb', line 659

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


704
705
706
# File 'lib/webpay/data_types.rb', line 704

def paid
  attributes['paid']
end

#paid=(value) ⇒ Object



708
709
710
# File 'lib/webpay/data_types.rb', line 708

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

#query_paramsObject



632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/webpay/data_types.rb', line 632

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');
  copy_if_exists(@attributes, result, 'captured', 'query_params');
  copy_if_exists(@attributes, result, 'paid', 'query_params');
  return result
end

#recursionObject



680
681
682
# File 'lib/webpay/data_types.rb', line 680

def recursion
  attributes['recursion']
end

#recursion=(value) ⇒ Object



684
685
686
# File 'lib/webpay/data_types.rb', line 684

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

#request_bodyObject



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

def request_body
  result = {}
  result
end

#shopObject



688
689
690
# File 'lib/webpay/data_types.rb', line 688

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



692
693
694
# File 'lib/webpay/data_types.rb', line 692

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