Class: Capybara::UI::TextTable::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/ui/text_table/mapping.rb

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ Mapping


5
6
7
8
9
# File 'lib/capybara/ui/text_table/mapping.rb', line 5

def initialize(settings = {})
  self.key               = settings[:key]
  self.value_transformer = transformer(settings[:value_transformer], :pass)
  self.key_transformer   = transformer(settings[:key_transformer], :keyword)
end

Instance Method Details

#set(instance, row, key, value) ⇒ Object


11
12
13
# File 'lib/capybara/ui/text_table/mapping.rb', line 11

def set(instance, row, key, value)
  row[transform_key(instance, key)] = transform_value(instance, value)
end