Module: BrokenWindow::Service
- Included in:
- Measurer, MetricMeasurer
- Defined in:
- app/services/broken_window/service.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
From brewhouse.io/blog/2014/04/30/gourmet-service-objects.html Possible responses 1: Fail loudly 2: Return ActiveRecord results 3: Response object Some services have several outcomes and complex error handling.
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/services/broken_window/service.rb', line 3 def self.included(base) base.extend(ClassMethods) # From http://brewhouse.io/blog/2014/04/30/gourmet-service-objects.html # Possible responses # 1: Fail loudly # 2: Return ActiveRecord results # 3: Response object # Some services have several outcomes and complex error handling. They return a response object which responds to success? and error(s). def call raise NotImplementedError end end |
Instance Method Details
#call ⇒ Object
From brewhouse.io/blog/2014/04/30/gourmet-service-objects.html Possible responses 1: Fail loudly 2: Return ActiveRecord results 3: Response object Some services have several outcomes and complex error handling. They return a response object which responds to success? and error(s).
12 13 14 |
# File 'app/services/broken_window/service.rb', line 12 def call raise NotImplementedError end |