class ResponsiveService::ResponsiveService

Attributes

responder_factory[R]
response_factory[R]

Public Class Methods

new(dependencies={}) click to toggle source
# File lib/responsive_service/responsive_service.rb, line 8
def initialize(dependencies={})
  @response_factory = dependencies[:response_factory] || dependencies.fetch(:responder_factory) { Response }
end

Public Instance Methods

call() { |response_factory(:unimplemented, "A ResponsiveService should implement the call method.\nThe call method should perform the relevant work of the service and yield a Response object.\n")| ... } click to toggle source
# File lib/responsive_service/responsive_service.rb, line 12
def call(&block)
  yield response_factory.new(:unimplemented, "A ResponsiveService should implement the call method.\nThe call method should perform the relevant work of the service and yield a ResponsiveService::Response object.\n")
end