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



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_expectsObject



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

def get_expects
  @expects || []
end

#get_optionalObject



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

def get_optional
  @optional || []
end

#get_returnsObject



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