Class: Plato::ContentCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/plato/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_parserObject (readonly)

Returns the value of attribute dest_parser.



47
48
49
# File 'lib/plato/config.rb', line 47

def dest_parser
  @dest_parser
end

#documentsObject (readonly)

Returns the value of attribute documents.



47
48
49
# File 'lib/plato/config.rb', line 47

def documents
  @documents
end

#nameObject (readonly)

Returns the value of attribute name.



47
48
49
# File 'lib/plato/config.rb', line 47

def name
  @name
end

#src_parserObject (readonly)

Returns the value of attribute src_parser.



47
48
49
# File 'lib/plato/config.rb', line 47

def src_parser
  @src_parser
end

#templateObject (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