Class: Wrappi::Client
- Inherits:
-
Object
- Object
- Wrappi::Client
- Includes:
- Fusu::Configurable
- Defined in:
- lib/wrappi/client.rb
Overview
This class is expected to handle all the configurations for your main module
Class Method Summary collapse
- .domain ⇒ Object
- .domain=(domain) ⇒ Object
- .errors ⇒ Object
- .root ⇒ Object
- .setup {|_self| ... } ⇒ Object
- .timeout ⇒ Object
- .timeout=(opts) ⇒ Object
Class Method Details
.domain ⇒ Object
41 42 43 44 |
# File 'lib/wrappi/client.rb', line 41 def self.domain fail "[#{self.class}] Bad configuration: you must set the `domain` config" unless @domain @domain end |
.domain=(domain) ⇒ Object
27 28 29 |
# File 'lib/wrappi/client.rb', line 27 def self.domain=(domain) @domain = domain end |
.errors ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/wrappi/client.rb', line 46 def self.errors [ TimeoutError, JsonParseError, NotAuthorizedAccessError ] end |
.root ⇒ Object
54 55 56 |
# File 'lib/wrappi/client.rb', line 54 def self.root Pathname.new(File.('../../', __FILE__)) end |
.setup {|_self| ... } ⇒ Object
23 24 25 |
# File 'lib/wrappi/client.rb', line 23 def self.setup yield(self) end |
.timeout ⇒ Object
35 36 37 38 39 |
# File 'lib/wrappi/client.rb', line 35 def self.timeout return @timeout if defined?(@timeout) self.timeout = {} @timeout end |
.timeout=(opts) ⇒ Object
31 32 33 |
# File 'lib/wrappi/client.rb', line 31 def self.timeout=(opts) @timeout = { write: 9, connect: 9, read: 9 }.merge(opts) end |