class Attrocity::KeyMapper

Attributes

default_value[R]
key[R]

Public Class Methods

new(key, default_value=nil) click to toggle source
# File lib/attrocity/mappers/key_mapper.rb, line 5
def initialize(key, default_value=nil)
  @key = key
  @default_value = default_value
end

Public Instance Methods

call(_, attributes_data) click to toggle source
# File lib/attrocity/mappers/key_mapper.rb, line 10
def call(_, attributes_data)
  attributes_data.fetch(key, default_value)
end