Class: Plato::ContentCategory
- Inherits:
-
Object
- Object
- Plato::ContentCategory
- Defined in:
- lib/plato/config.rb
Instance Attribute Summary collapse
-
#dest_parser ⇒ Object
readonly
Returns the value of attribute dest_parser.
-
#documents ⇒ Object
readonly
Returns the value of attribute documents.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#src_parser ⇒ Object
readonly
Returns the value of attribute src_parser.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #dest_path(data) ⇒ Object
-
#initialize(name, src_t, dest_t, sort, template) ⇒ ContentCategory
constructor
A new instance of ContentCategory.
- #match(path) ⇒ Object
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(name, src_t, dest_t, sort, template) ⇒ ContentCategory
Returns a new instance of ContentCategory.
49 50 51 52 53 54 55 |
# File 'lib/plato/config.rb', line 49 def initialize(name, src_t, dest_t, sort, template) @name = name @documents = DocumentCollection.new(sort) @src_parser = PathTemplate.new(src_t) @dest_parser = PathTemplate.new(dest_t) @template = "_#{template}" if template end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
60 61 62 |
# File 'lib/plato/config.rb', line 60 def method_missing(method, *args, &block) documents.send(method, *args, &block) end |
Instance Attribute Details
#dest_parser ⇒ Object (readonly)
Returns the value of attribute dest_parser.
47 48 49 |
# File 'lib/plato/config.rb', line 47 def dest_parser @dest_parser end |
#documents ⇒ Object (readonly)
Returns the value of attribute documents.
47 48 49 |
# File 'lib/plato/config.rb', line 47 def documents @documents end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
47 48 49 |
# File 'lib/plato/config.rb', line 47 def name @name end |
#src_parser ⇒ Object (readonly)
Returns the value of attribute src_parser.
47 48 49 |
# File 'lib/plato/config.rb', line 47 def src_parser @src_parser end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
47 48 49 |
# File 'lib/plato/config.rb', line 47 def template @template end |
Instance Method Details
#dest_path(data) ⇒ Object
58 |
# File 'lib/plato/config.rb', line 58 def dest_path(data); dest_parser.materialize(data) end |
#match(path) ⇒ Object
57 |
# File 'lib/plato/config.rb', line 57 def match(path); src_parser.parse(path) end |