Module: SimpleService::ServiceBase::ClassMethods

Included in:
Command, Organizer
Defined in:
lib/simple_service/service_base.rb

Instance Method Summary collapse

Instance Method Details

#call(context = {}) ⇒ Object

allow execution of the service or commands from the class level for those that prefer that style



27
28
29
# File 'lib/simple_service/service_base.rb', line 27

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_expectsObject



9
10
11
# File 'lib/simple_service/service_base.rb', line 9

def get_expects
  @expects || []
end

#get_returnsObject



17
18
19
# File 'lib/simple_service/service_base.rb', line 17

def get_returns
  @returns || []
end

#returns(*args) ⇒ Object



13
14
15
# File 'lib/simple_service/service_base.rb', line 13

def returns(*args)
  @returns = args
end

#skip_validation(skip = true) ⇒ Object



21
22
23
# File 'lib/simple_service/service_base.rb', line 21

def skip_validation(skip=true)
  @skip_validation = skip
end