Class: Toolbelt::Service

Inherits:
Object
  • Object
show all
Includes:
Util::OptionValidator
Defined in:
lib/toolbelt/service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::OptionValidator

#required_options, #validate_options!

Constructor Details

#initialize(options = {}) ⇒ Service

Returns a new instance of Service.



11
12
13
14
# File 'lib/toolbelt/service.rb', line 11

def initialize(options = {})
  validate_options!(options)
  @options = Hashie::Mash.new(options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/toolbelt/service.rb', line 5

def options
  @options
end

Class Method Details

.call(options = {}) ⇒ Object



7
8
9
# File 'lib/toolbelt/service.rb', line 7

def self.call(options = {})
  new(options).call
end

Instance Method Details

#callObject



16
17
18
# File 'lib/toolbelt/service.rb', line 16

def call
  fail Toolbelt::OverrideInSubclassError
end