Class: Philiprehberger::DataMapper::MappingResult

Inherits:
Object
  • Object
show all
Defined in:
lib/philiprehberger/data_mapper/mapping_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 6

def errors
  @errors
end

#valueObject (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

Returns:

  • (Boolean)


13
14
15
# File 'lib/philiprehberger/data_mapper/mapping_result.rb', line 13

def valid?
  @errors.empty?
end