Class: SolidService::Base
- Inherits:
-
Object
- Object
- SolidService::Base
- Defined in:
- lib/solidservice/base.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #fail(params = {}) ⇒ Object
- #fail!(params = {}) ⇒ Object
-
#initialize(params) ⇒ Base
constructor
A new instance of Base.
- #success(params = {}) ⇒ Object
-
#success!(params = {}) ⇒ Object
Private.
Constructor Details
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
35 36 37 |
# File 'lib/solidservice/base.rb', line 35 def params @params end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
35 36 37 |
# File 'lib/solidservice/base.rb', line 35 def state @state end |
Class Method Details
Instance Method Details
#call ⇒ Object
42 43 44 |
# File 'lib/solidservice/base.rb', line 42 def call raise "Override please" end |
#fail(params = {}) ⇒ Object
64 65 66 |
# File 'lib/solidservice/base.rb', line 64 def fail(params={}) @state = State.new(:fail, params) end |
#fail!(params = {}) ⇒ Object
55 56 57 58 |
# File 'lib/solidservice/base.rb', line 55 def fail!(params={}) @state = State.new(:fail, params) raise Failure.new end |