Class: Flickrage::Worker::Base

Inherits:
Object
  • Object
show all
Includes:
Helpers::Log, Helpers::Tty
Defined in:
lib/flickrage/worker/base.rb

Direct Known Subclasses

Compose, Download, Resize, Search

Constant Summary collapse

MAX_ASK_ERRORS =
3
%w(keyword id).freeze
PRINT_IMAGE_HEADERS_LITE + %w(url title width height)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Tty

#spinner

Methods included from Helpers::Log

#logger, #speaker

Constructor Details

#initialize(opts = {}, service = nil) ⇒ Base

Returns a new instance of Base.



18
19
20
21
22
23
# File 'lib/flickrage/worker/base.rb', line 18

def initialize(opts = {}, service = nil)
  @service = service
  @opts = default_opts.merge(opts)
  @spin = nil
  @opts[:ask_error_counter] = 0
end

Instance Attribute Details

#optsObject

Returns the value of attribute opts.



16
17
18
# File 'lib/flickrage/worker/base.rb', line 16

def opts
  @opts
end

#serviceObject

Returns the value of attribute service.



16
17
18
# File 'lib/flickrage/worker/base.rb', line 16

def service
  @service
end

#spinObject

Returns the value of attribute spin.



16
17
18
# File 'lib/flickrage/worker/base.rb', line 16

def spin
  @spin
end

Instance Method Details

#callObject



25
# File 'lib/flickrage/worker/base.rb', line 25

def call; end