Module: Pombo

Defined in:
lib/pombo.rb,
lib/pombo/logger.rb,
lib/pombo/package.rb,
lib/pombo/version.rb,
lib/pombo/support.rb,
lib/pombo/services.rb,
lib/pombo/exception.rb,
lib/pombo/webservice.rb,
lib/pombo/package/item.rb,
lib/pombo/configuration.rb,
lib/pombo/webservice/cpp.rb,
lib/pombo/package/format.rb,
lib/pombo/webservice/base.rb,
lib/pombo/webservice/cpp/response.rb,
lib/pombo/webservice/cpp/base_request.rb,
lib/pombo/webservice/cpp/shipping_request.rb,
lib/pombo/webservice/cpp/service_response.rb,
lib/pombo/webservice/cpp/delivery_time_request.rb,
lib/pombo/webservice/cpp/shipping_value_request.rb

Overview

It allows you to configure and perform consulting delivery services

For more information read the file README-EN

Defined Under Namespace

Modules: Services, Support, Webservice Classes: Configuration, ConfigurationError, Error, Logger, Package, WebserviceError

Constant Summary collapse

VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.configurationsPombo::Configuration

Returns current settings

Returns:


41
42
43
# File 'lib/pombo.rb', line 41

def self.configurations
  @@configurations ||= Configuration.new
end

.delivery_time(package) ⇒ Array<Pombo::Webservice::CPP::ServiceResponse>

Perform the quotation of delivery of consulting delivery time

Parameters:

Returns:


55
56
57
# File 'lib/pombo.rb', line 55

def self.delivery_time(package)
  Webservice::CPP.delivery_time(package)
end

.loggerPombo::Logger

Returns the default log object Pombo

Returns:


75
76
77
# File 'lib/pombo.rb', line 75

def self.logger
  configurations.logger
end

.set(**args) ⇒ Pombo::Configuration

Note:

Does not modify the default settings

Tells the settings that will be used at this time

Returns:


36
37
38
# File 'lib/pombo.rb', line 36

def self.set(**args)
  @@configurations = Configuration.new args
end

.setup {|config| ... } ⇒ Pombo::Configuration

Inform settings for persisting with default

Yields:

  • (config)

    with the configuration data.

Returns:


29
30
31
# File 'lib/pombo.rb', line 29

def self.setup(&block)
  Configuration.setup(&block)
end

.shipping(package) ⇒ Array<Pombo::Webservice::CPP::ServiceResponse>

Perform the quotation of delivery of consulting services value and delivery time

Parameters:

Returns:


48
49
50
# File 'lib/pombo.rb', line 48

def self.shipping(package)
  Webservice::CPP.shipping(package)
end

.shipping_value(package) ⇒ Array<Pombo::Webservice::CPP::ServiceResponse>

Perform the quotation of delivery of consulting services value

Parameters:

Returns:


62
63
64
# File 'lib/pombo.rb', line 62

def self.shipping_value(package)
  Webservice::CPP.shipping_value(package)
end

.t(*args) ⇒ String

Performs internationalization for informed locale in settings

Returns:

  • (String)

    internationalized text


68
69
70
71
72
# File 'lib/pombo.rb', line 68

def self.t(*args)
  I18n.with_locale configurations.locale do
    I18n.translate args
  end.first
end