Class: Estratto::Register

Inherits:
Object
  • Object
show all
Defined in:
lib/estratto/register.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, register_layout) ⇒ Register

Returns a new instance of Register.



8
9
10
11
# File 'lib/estratto/register.rb', line 8

def initialize(line, register_layout)
  @line = line
  @register_layout = register_layout
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



6
7
8
# File 'lib/estratto/register.rb', line 6

def line
  @line
end

#register_layoutObject (readonly)

Returns the value of attribute register_layout.



6
7
8
# File 'lib/estratto/register.rb', line 6

def register_layout
  @register_layout
end

Instance Method Details

#refineObject



13
14
15
16
17
18
19
# File 'lib/estratto/register.rb', line 13

def refine
  register_layout.map do |layout|
    {
      layout['name'].to_sym => coerced_data(layout['range'], layout['type'], layout['formats'])
    }
  end.inject(&:merge)
end