Class: Attrocity::ValueExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/attrocity/value_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, mapper:, coercer:) ⇒ ValueExtractor

Returns a new instance of ValueExtractor.



5
6
7
# File 'lib/attrocity/value_extractor.rb', line 5

def initialize(data, mapper:, coercer:)
  @data, @mapper, @coercer = data, mapper, coercer
end

Instance Attribute Details

#coercerObject (readonly)

Returns the value of attribute coercer.



3
4
5
# File 'lib/attrocity/value_extractor.rb', line 3

def coercer
  @coercer
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/attrocity/value_extractor.rb', line 3

def data
  @data
end

#mapperObject (readonly)

Returns the value of attribute mapper.



3
4
5
# File 'lib/attrocity/value_extractor.rb', line 3

def mapper
  @mapper
end

Instance Method Details

#valueObject



9
10
11
# File 'lib/attrocity/value_extractor.rb', line 9

def value
  coerce(map)
end