Class: Philiprehberger::DataMapper::MappingResult
- Inherits:
-
Object
- Object
- Philiprehberger::DataMapper::MappingResult
- Defined in:
- lib/philiprehberger/data_mapper/mapping_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, errors = []) ⇒ MappingResult
constructor
A new instance of MappingResult.
- #valid? ⇒ Boolean
Constructor Details
#initialize(value, errors = []) ⇒ MappingResult
Returns a new instance of MappingResult.
8 9 10 11 |
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 8 def initialize(value, errors = []) @value = value @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 6 def errors @errors end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 6 def value @value end |
Instance Method Details
#valid? ⇒ Boolean
13 14 15 |
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 13 def valid? @errors.empty? end |