Class: WebPay::CreatedRange

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

Returns a new instance of CreatedRange.



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

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



714
715
716
# File 'lib/webpay/data_types.rb', line 714

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



721
722
723
724
725
726
727
728
729
# File 'lib/webpay/data_types.rb', line 721

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



716
717
718
# File 'lib/webpay/data_types.rb', line 716

def self.fields
  ['gt', 'gte', 'lt', 'lte']
end

Instance Method Details

#gtObject

attributes accessors



753
754
755
# File 'lib/webpay/data_types.rb', line 753

def gt
  attributes['gt']
end

#gt=(value) ⇒ Object



757
758
759
# File 'lib/webpay/data_types.rb', line 757

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

#gteObject



761
762
763
# File 'lib/webpay/data_types.rb', line 761

def gte
  attributes['gte']
end

#gte=(value) ⇒ Object



765
766
767
# File 'lib/webpay/data_types.rb', line 765

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

#ltObject



769
770
771
# File 'lib/webpay/data_types.rb', line 769

def lt
  attributes['lt']
end

#lt=(value) ⇒ Object



773
774
775
# File 'lib/webpay/data_types.rb', line 773

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

#lteObject



777
778
779
# File 'lib/webpay/data_types.rb', line 777

def lte
  attributes['lte']
end

#lte=(value) ⇒ Object



781
782
783
# File 'lib/webpay/data_types.rb', line 781

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

#query_paramsObject



742
743
744
745
746
747
748
749
# File 'lib/webpay/data_types.rb', line 742

def query_params
  result = {}
  copy_if_exists(@attributes, result, 'gt', 'query_params');
  copy_if_exists(@attributes, result, 'gte', 'query_params');
  copy_if_exists(@attributes, result, 'lt', 'query_params');
  copy_if_exists(@attributes, result, 'lte', 'query_params');
  return result
end

#request_bodyObject



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

def request_body
  result = {}
  result
end