Module: Refried

Defined in:
lib/refried.rb,
lib/refried/jobs.rb,
lib/refried/tube.rb,
lib/refried/puter.rb,
lib/refried/tubes.rb,
lib/refried/getter.rb,
lib/refried/configuration.rb

Overview

Refried core API methods

based in part on the design of backburner (https://github.com/nesquena/backburner MIT license)

Defined Under Namespace

Modules: Getter, Puter, Tube Classes: Configuration, Jobs, Tubes

Class Method Summary collapse

Class Method Details

.configurationConfiguration

Returns the singleton class’s configuration object

Returns:

  • the current configuration object



31
32
33
# File 'lib/refried.rb', line 31

def configuration
  @configuration ||= Configuration.new
end

.configure(opts = {}, &block) {|configuration| ... } ⇒ Configuration

Allows the user to set configuration options

by yielding the configuration block

Parameters:

  • (defaults to: {})

    an optional hash of options, supported options are ‘reset: true`

  • an optional configuration block

Yields:

Returns:

  • the current configuration object



20
21
22
23
24
25
26
# File 'lib/refried.rb', line 20

def configure(opts = {}, &block)
  if opts.has_key?(:reset) && opts[:reset]
    @configuration = nil
  end
  yield(configuration) if block_given?
  configuration
end

.jobsBeaneater::Jobs

Returns the Beaneater::Jobs object, which exposes methods the allow finding jobs

Returns:

  • the object for finding jobs



45
46
47
# File 'lib/refried.rb', line 45

def jobs
  @jobs ||= Jobs.new
end

.tubesBeaneater::Tubes

Returns the Beaneater::Tubes object, which is the collection of all the Beaneater Tube objects

Returns:

  • the collection of Beaneater Tubes



38
39
40
# File 'lib/refried.rb', line 38

def tubes
  @tubes ||= Tubes.new
end