Class: Ehpt::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ehpt/base.rb

Direct Known Subclasses

CreateStories, CreateStory, GetProject

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'lib/ehpt/base.rb', line 9

def initialize(*args)
  @data = nil
  @errors = []
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/ehpt/base.rb', line 3

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



3
4
5
# File 'lib/ehpt/base.rb', line 3

def errors
  @errors
end

Class Method Details

.call(*args) ⇒ Object



5
6
7
# File 'lib/ehpt/base.rb', line 5

def self.call(*args)
  new(*args).call
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ehpt/base.rb', line 18

def error?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/ehpt/base.rb', line 14

def success?
  errors.empty?
end