Class: Confinement::Content

Inherits:
Object
  • Object
show all
Includes:
Blob, RenderableBlob, RouteableBlob
Defined in:
lib/confinement.rb

Instance Attribute Summary collapse

Attributes included from RenderableBlob

#renderers

Attributes included from RouteableBlob

#output_path, #url_path

Attributes included from Blob

#input_path

Instance Method Summary collapse

Constructor Details

#initialize(input_path:, layout: nil, locals: {}, renderers: :guess) ⇒ Content

Returns a new instance of Content.



445
446
447
448
449
450
451
# File 'lib/confinement.rb', line 445

def initialize(input_path:, layout: nil, locals: {}, renderers: :guess)
  self.input_path = input_path

  self.layout = layout
  self.locals = locals
  self.renderers = renderers
end

Instance Attribute Details

#layoutObject

Returns the value of attribute layout.



454
455
456
# File 'lib/confinement.rb', line 454

def layout
  @layout
end

#localsObject

Returns the value of attribute locals.



453
454
455
# File 'lib/confinement.rb', line 453

def locals
  @locals
end

Instance Method Details

#bodyObject



456
457
458
459
# File 'lib/confinement.rb', line 456

def body
  parse_body_and_frontmatter
  @body
end

#frontmatterObject



461
462
463
464
# File 'lib/confinement.rb', line 461

def frontmatter
  parse_body_and_frontmatter
  @frontmatter
end