Class: Estratto::Layout::Reader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Reader

Returns a new instance of Reader.



8
9
10
# File 'lib/estratto/layout/reader.rb', line 8

def initialize(file)
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



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

def file
  @file
end

Instance Method Details

#layoutObject



16
17
18
# File 'lib/estratto/layout/reader.rb', line 16

def layout
  template['layout']
end

#multiregister?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/estratto/layout/reader.rb', line 24

def multiregister?
  layout.dig('multi-register') || false
end

#registersObject



20
21
22
# File 'lib/estratto/layout/reader.rb', line 20

def registers
  @registers ||= layout['registers']
end

#templateObject



12
13
14
# File 'lib/estratto/layout/reader.rb', line 12

def template
  @template ||= YAML.load_file(file)
end