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.



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

def initialize(hash = {})
  hash = normalize_hash(hash)
  @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
  ['gt', 'gte', 'lt', 'lte']
end

Instance Method Details

#gtObject

attributes accessors



642
643
644
# File 'lib/webpay/data_types.rb', line 642

def gt
  attributes['gt']
end

#gt=(value) ⇒ Object



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

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

#gteObject



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

def gte
  attributes['gte']
end

#gte=(value) ⇒ Object



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

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

#ltObject



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

def lt
  attributes['lt']
end

#lt=(value) ⇒ Object



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

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

#lteObject



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

def lte
  attributes['lte']
end

#lte=(value) ⇒ Object



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

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

#query_paramsObject



631
632
633
634
635
636
637
638
# File 'lib/webpay/data_types.rb', line 631

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



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

def request_body
  result = {}
  result
end