Class: Teodoro::ArquivoData::ChavesValores

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/teodoro/arquivo_data.rb

Defined Under Namespace

Classes: Item

Instance Method Summary collapse

Constructor Details

#initialize(itens) ⇒ ChavesValores

Returns a new instance of ChavesValores.



99
100
101
102
103
104
# File 'lib/teodoro/arquivo_data.rb', line 99

def initialize(itens)
  @itens = itens
           .map { Item.new(*_1) }
           .select(&:selecionar?)
           .map { [_1.chave, _1.valor] }
end

Instance Method Details

#to_hashObject



108
109
110
# File 'lib/teodoro/arquivo_data.rb', line 108

def to_hash
  itens.to_h
end