class ReactiveShipping::Platform

Attributes

conf[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/reactive_freight/platform.rb, line 7
def initialize(options = {})
  requirements.each { |key| requires!(options, key) }
  @conf = nil
  @debug = options[:debug].blank? ? false : true
  @options = options
  @last_request = nil
  @test_mode = @options[:test]

  conf_path = File.join(__dir__, 'configuration', 'platforms', "#{self.class.ancestors[1].name.split('::')[1].underscore}.yml")
  @conf = YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol])

  conf_path = File.join(__dir__, 'configuration', 'carriers', "#{self.class.to_s.split('::')[1].underscore}.yml")
  @conf = @conf.deep_merge(YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol]))

  @rates_with_excessive_length_fees = @conf.dig(:attributes, :rates, :with_excessive_length_fees)
end

Public Instance Methods

find_bol(*) click to toggle source
# File lib/reactive_freight/platform.rb, line 24
def find_bol(*)
  raise NotImplementedError, "#{self.class.name}: #find_bol not supported"
end
find_estimate(*) click to toggle source
# File lib/reactive_freight/platform.rb, line 28
def find_estimate(*)
  raise NotImplementedError, "#{self.class.name}: #find_estimate not supported"
end
find_pod(*) click to toggle source
# File lib/reactive_freight/platform.rb, line 32
def find_pod(*)
  raise NotImplementedError, "#{self.class.name}: #find_pod not supported"
end