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.



555
556
557
558
# File 'lib/webpay/data_types.rb', line 555

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



538
539
540
# File 'lib/webpay/data_types.rb', line 538

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



545
546
547
548
549
550
551
552
553
# File 'lib/webpay/data_types.rb', line 545

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



540
541
542
# File 'lib/webpay/data_types.rb', line 540

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

Instance Method Details

#gtObject

attributes accessors



577
578
579
# File 'lib/webpay/data_types.rb', line 577

def gt
  attributes['gt']
end

#gt=(value) ⇒ Object



581
582
583
# File 'lib/webpay/data_types.rb', line 581

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

#gteObject



585
586
587
# File 'lib/webpay/data_types.rb', line 585

def gte
  attributes['gte']
end

#gte=(value) ⇒ Object



589
590
591
# File 'lib/webpay/data_types.rb', line 589

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

#ltObject



593
594
595
# File 'lib/webpay/data_types.rb', line 593

def lt
  attributes['lt']
end

#lt=(value) ⇒ Object



597
598
599
# File 'lib/webpay/data_types.rb', line 597

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

#lteObject



601
602
603
# File 'lib/webpay/data_types.rb', line 601

def lte
  attributes['lte']
end

#lte=(value) ⇒ Object



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

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

#query_paramsObject



566
567
568
569
570
571
572
573
# File 'lib/webpay/data_types.rb', line 566

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



561
562
563
564
# File 'lib/webpay/data_types.rb', line 561

def request_body
  result = {}
  result
end