Class: Estratto::Layout::Reader
- Inherits:
-
Object
- Object
- Estratto::Layout::Reader
- Defined in:
- lib/estratto/layout/reader.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(file) ⇒ Reader
constructor
A new instance of Reader.
- #layout ⇒ Object
- #multiregister? ⇒ Boolean
- #registers ⇒ Object
- #template ⇒ Object
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
#file ⇒ Object (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
#layout ⇒ Object
16 17 18 |
# File 'lib/estratto/layout/reader.rb', line 16 def layout template['layout'] end |
#multiregister? ⇒ Boolean
24 25 26 |
# File 'lib/estratto/layout/reader.rb', line 24 def multiregister? layout.dig('multi-register') || false end |
#registers ⇒ Object
20 21 22 |
# File 'lib/estratto/layout/reader.rb', line 20 def registers @registers ||= layout['registers'] end |
#template ⇒ Object
12 13 14 |
# File 'lib/estratto/layout/reader.rb', line 12 def template @template ||= YAML.load_file(file) end |