Class: Flowcation::Partial
- Inherits:
-
Object
- Object
- Flowcation::Partial
- Includes:
- Callbacks, Substitutions
- Defined in:
- lib/flowcation/partial.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(doc, path, substitutions) ⇒ Partial
constructor
A new instance of Partial.
Methods included from Substitutions
Constructor Details
#initialize(doc, path, substitutions) ⇒ Partial
Returns a new instance of Partial.
5 6 7 8 9 |
# File 'lib/flowcation/partial.rb', line 5 def initialize(doc, path, substitutions) @doc = doc @path = path @substitutions = substitutions || [] end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/flowcation/partial.rb', line 4 def path @path end |
Class Method Details
.from_config(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/flowcation/partial.rb', line 17 def self.from_config(={}) doc = Nokogiri::HTML(File.new(['file'])).xpath("//body").xpath(['xpath']) doc = doc[0].children if ['type'] == 'content' partial = Flowcation::Partial.new \ doc, ['path'], ['substitutions'] end |