Module: AdaptlyCube

Defined in:
lib/adaptly_cube.rb

Defined Under Namespace

Classes: Configuration

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationAdaptlyCube::Configuration

Gets the global configuration



22
23
24
# File 'lib/adaptly_cube.rb', line 22

def configuration
    @configuration ||= Configuration.new
end

Class Method Details

.configure {|AdaptlyCube::Configuration| ... } ⇒ Object

Configures the AdaptlyCube gem

Examples:

AdaptlyCube.configure do |config|
        config.cube_port = 69
end

Yields:



33
34
35
# File 'lib/adaptly_cube.rb', line 33

def configure
    yield(self.configuration)
end

.send(*args) { ... } ⇒ Object

Creates a cube instance (if non-existent) and sends message

Examples:

AdaptlyCube.send "facebook_api", payload

Yields:

  • Number of bytes in message sent



42
43
44
45
# File 'lib/adaptly_cube.rb', line 42

def send(*args)
    @@cube ||= ::Cube::Client.new self.configuration.cube_host, self.configuration.cube_port
    @@cube.send *args
end