Class: Itsf::Services::V2::Response::Base
- Inherits:
-
Object
- Object
- Itsf::Services::V2::Response::Base
- Extended by:
- ActiveModel::Naming
- Defined in:
- lib/itsf/services/v2/response/base.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#success ⇒ Object
writeonly
Sets the attribute success.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #read_attribute_for_validation(attr) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize ⇒ Base
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
#errors ⇒ Object
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, = {}) attr end |
.lookup_ancestors ⇒ Object
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 |