Class: Stack::Templates::Article

Inherits:
Object
  • Object
show all
Includes:
Parsable, Stack::Template
Defined in:
lib/stack/templates/article.rb

Instance Attribute Summary collapse

Attributes included from Parsable

#data, #inline_data, #raw

Attributes included from Stack::Template

#basename, #extension, #generator, #original_extension, #path, #raw

Instance Method Summary collapse

Methods included from Parsable

#extract_yaml, #parse!

Methods included from Stack::Template

#read, #render, #template_payload, #to_hash, #write_basename, #write_filename, #write_path

Constructor Details

#initialize(*args) ⇒ Article

Returns a new instance of Article.



9
10
11
12
13
# File 'lib/stack/templates/article.rb', line 9

def initialize(*args)
  super
  
  parse!
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



7
8
9
# File 'lib/stack/templates/article.rb', line 7

def content
  @content
end

Instance Method Details

#payloadObject



25
26
27
28
29
# File 'lib/stack/templates/article.rb', line 25

def payload
  super.merge({
    :content => self.content
  })
end

#transform(content = self.raw) ⇒ Object



19
20
21
22
23
# File 'lib/stack/templates/article.rb', line 19

def transform(content = self.raw)
 self.content = super
 
 self.content
end

#write!(*args) ⇒ Object



15
16
17
# File 'lib/stack/templates/article.rb', line 15

def write!(*args)
  super
end