Class: Worldline::Acquiring::SDK::V1::Domain::DateRange

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/date_range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#greater_equal ⇒ Date

Returns the current value of greater_equal.

Returns:

  • (Date) —

    the current value of greater_equal



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/date_range.rb', line 15

def greater_equal
  @greater_equal
end

#lower_equal ⇒ Date

Returns the current value of lower_equal.

Returns:

  • (Date) —

    the current value of lower_equal



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/date_range.rb', line 15

def lower_equal
  @lower_equal
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/worldline/acquiring/sdk/v1/domain/date_range.rb', line 29

def from_hash(hash)
  super
  if hash.has_key? 'greaterEqual'
    @greater_equal = Date.parse(hash['greaterEqual'])
  end
  if hash.has_key? 'lowerEqual'
    @lower_equal = Date.parse(hash['lowerEqual'])
  end
end

#to_h ⇒ Hash

Returns:

  • (Hash)


22
23
24
25
26
27
# File 'lib/worldline/acquiring/sdk/v1/domain/date_range.rb', line 22

def to_h
  hash = super
  hash['greaterEqual'] = @greater_equal.iso8601 unless @greater_equal.nil?
  hash['lowerEqual'] = @lower_equal.iso8601 unless @lower_equal.nil?
  hash
end