Module: SimpleService::ServiceBase::ClassMethods
Instance Method Summary collapse
-
#call(context = {}) ⇒ Object
allow execution of the service or commands from the class level for those that prefer that style.
- #expects(*args) ⇒ Object
- #get_expects ⇒ Object
- #get_optional ⇒ Object
- #get_returns ⇒ Object
- #optional(*args) ⇒ Object
- #returns(*args) ⇒ Object
- #skip_validation(skip = true) ⇒ Object
Instance Method Details
#call(context = {}) ⇒ Object
allow execution of the service or commands from the class level for those that prefer that style
35 36 37 |
# File 'lib/simple_service/service_base.rb', line 35 def call(context = {}) new(context).call end |
#expects(*args) ⇒ Object
5 6 7 |
# File 'lib/simple_service/service_base.rb', line 5 def expects(*args) @expects = args end |
#get_expects ⇒ Object
9 10 11 |
# File 'lib/simple_service/service_base.rb', line 9 def get_expects @expects || [] end |
#get_optional ⇒ Object
17 18 19 |
# File 'lib/simple_service/service_base.rb', line 17 def get_optional @optional || [] end |
#get_returns ⇒ Object
25 26 27 |
# File 'lib/simple_service/service_base.rb', line 25 def get_returns @returns || [] end |
#optional(*args) ⇒ Object
13 14 15 |
# File 'lib/simple_service/service_base.rb', line 13 def optional(*args) @optional = args end |
#returns(*args) ⇒ Object
21 22 23 |
# File 'lib/simple_service/service_base.rb', line 21 def returns(*args) @returns = args end |
#skip_validation(skip = true) ⇒ Object
29 30 31 |
# File 'lib/simple_service/service_base.rb', line 29 def skip_validation(skip=true) @skip_validation = skip end |