Sha256: 9bebd6f02f92d036948668c9cb3ed07ffe029826d1395e07a3a6396927dcc799
Contents?: true
Size: 748 Bytes
Versions: 3
Compression:
Stored size: 748 Bytes
Contents
require_relative 'data/coercer' require_relative 'helpers/range' module Estratto class Register attr_reader :line, :index, :register_layout def initialize(line, index, register_layout) @line = line @index = index @register_layout = register_layout end def refine register_layout.map do |layout| { layout['name'].to_sym => coerced_data(layout['range'], layout['type'], layout['formats']) } end.inject(&:merge) end private def coerced_data(range, type, formats) Estratto::Data::Coercer.new( index: index, data: line[Estratto::Helpers::Range.for(range)], type: type, formats: formats || {} ).build end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
estratto-1.0.5 | lib/estratto/register.rb |
estratto-1.0.4 | lib/estratto/register.rb |
estratto-1.0.3 | lib/estratto/register.rb |