Class: Itsf::Services::V2::Response::Base

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Defined in:
lib/itsf/services/v2/response/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase



11
12
13
14
# File 'lib/itsf/services/v2/response/base.rb', line 11

def initialize
  @errors  = ActiveModel::Errors.new(self)
  # @success = false
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



8
9
10
# File 'lib/itsf/services/v2/response/base.rb', line 8

def errors
  @errors
end

#success=(value) ⇒ Object (writeonly)

Sets the attribute success



9
10
11
# File 'lib/itsf/services/v2/response/base.rb', line 9

def success=(value)
  @success = value
end

Class Method Details

.human_attribute_name(attr, options = {}) ⇒ Object



24
25
26
# File 'lib/itsf/services/v2/response/base.rb', line 24

def self.human_attribute_name(attr, options = {})
  attr
end

.lookup_ancestorsObject



28
29
30
# File 'lib/itsf/services/v2/response/base.rb', line 28

def self.lookup_ancestors
  [self]
end

Instance Method Details

#read_attribute_for_validation(attr) ⇒ Object



20
21
22
# File 'lib/itsf/services/v2/response/base.rb', line 20

def read_attribute_for_validation(attr)
  send(attr)
end

#success?Boolean



16
17
18
# File 'lib/itsf/services/v2/response/base.rb', line 16

def success?
  @errors.blank?
end