Module: Serviceable::ClassMethods

Defined in:
lib/serviceable.rb

Instance Method Summary collapse

Instance Method Details

#call(*args) ⇒ Object



24
25
26
27
28
29
# File 'lib/serviceable.rb', line 24

def call(*args)
  obj = new(*args)
  circuit.run do
    obj.call
  end
end

#circuitObject



20
21
22
# File 'lib/serviceable.rb', line 20

def circuit
  Circuitbox.circuit(service_name, circuit_options)
end

#circuit_optionsObject



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

def circuit_options
  {}
end

#service_nameObject



12
13
14
# File 'lib/serviceable.rb', line 12

def service_name
  self.name
end