Class: Deliveries::Couriers::CorreosExpress::Pickups::CutoffTime::FormatParams

Inherits:
Object
  • Object
show all
Defined in:
lib/deliveries/couriers/correos_express/pickups/cutoff_time/format_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country:, postcode:) ⇒ FormatParams

Returns a new instance of FormatParams.



9
10
11
12
# File 'lib/deliveries/couriers/correos_express/pickups/cutoff_time/format_params.rb', line 9

def initialize(country:, postcode:)
  self.country = country
  self.postcode = postcode
end

Instance Attribute Details

#countryObject

Returns the value of attribute country.



7
8
9
# File 'lib/deliveries/couriers/correos_express/pickups/cutoff_time/format_params.rb', line 7

def country
  @country
end

#postcodeObject

Returns the value of attribute postcode.



7
8
9
# File 'lib/deliveries/couriers/correos_express/pickups/cutoff_time/format_params.rb', line 7

def postcode
  @postcode
end

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
# File 'lib/deliveries/couriers/correos_express/pickups/cutoff_time/format_params.rb', line 14

def execute
  params = {
    strCP: postcode,
    strPais: country_code_to_id(country)
  }

  params.to_json
end