Class: Servicify::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/servicify/object.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



9
10
11
# File 'lib/servicify/object.rb', line 9

def result
  @result
end

Class Method Details

.call(*arg) ⇒ Object



4
5
6
# File 'lib/servicify/object.rb', line 4

def call(*arg)
  new(*arg).constructor
end

Instance Method Details

#callObject



27
28
29
# File 'lib/servicify/object.rb', line 27

def call
  fail NotImplementedError unless defined?(super)
end

#constructorObject



10
11
12
13
# File 'lib/servicify/object.rb', line 10

def constructor
  @result = call
  self
end

#errorsObject



23
24
25
# File 'lib/servicify/object.rb', line 23

def errors
  @errors ||= Servicify::Common::Errors.new
end

#failure?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/servicify/object.rb', line 19

def failure?
  errors.any?
end

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/servicify/object.rb', line 15

def success?
  !failure?
end