Module: Lce

Defined in:
lib/lce.rb,
lib/lce/offer.rb,
lib/lce/order.rb,
lib/lce/quote.rb,
lib/lce/client.rb,
lib/lce/product.rb,
lib/lce/version.rb,
lib/lce/client/errors.rb,
lib/lce/client/request.rb,
lib/lce/client/connection.rb

Defined Under Namespace

Classes: Client, Configuration, Offer, Order, Product, Quote

Constant Summary collapse

VERSION =
"0.0.5"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject

Returns the value of attribute client.



12
13
14
# File 'lib/lce.rb', line 12

def client
  @client
end

.configurationObject

Returns the value of attribute configuration.



12
13
14
# File 'lib/lce.rb', line 12

def configuration
  @configuration
end

Class Method Details

.checkObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/lce.rb', line 31

def self.check
  begin
    client.get
  rescue Lce::Client::Errors::LceError => e
    if configuration.raise_lce_errors
      raise e
    else
      configuration.logger.warn(e.to_s)
    end
    return false
  end
end

.configure {|configuration| ... } ⇒ Object

Yields:



23
24
25
# File 'lib/lce.rb', line 23

def self.configure
  yield(configuration)
end

.resetObject



27
28
29
# File 'lib/lce.rb', line 27

def self.reset
  @configuration = Configuration.new
end