Class: Jekyll_Tagger::Config
- Inherits:
-
Object
- Object
- Jekyll_Tagger::Config
- Defined in:
- lib/jekyll_tagger/config.rb
Instance Attribute Summary collapse
-
#exclude ⇒ Object
Returns the value of attribute exclude.
-
#folders ⇒ Object
Returns the value of attribute folders.
-
#include ⇒ Object
Returns the value of attribute include.
-
#indexes ⇒ Object
Returns the value of attribute indexes.
-
#layouts ⇒ Object
Returns the value of attribute layouts.
-
#names ⇒ Object
Returns the value of attribute names.
-
#page_show ⇒ Object
Returns the value of attribute page_show.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#post_order ⇒ Object
Returns the value of attribute post_order.
-
#pretty ⇒ Object
Returns the value of attribute pretty.
-
#slugs ⇒ Object
Returns the value of attribute slugs.
-
#style ⇒ Object
Returns the value of attribute style.
-
#types ⇒ Object
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(config) ⇒ Config
constructor
A new instance of Config.
- #value(key, default) ⇒ Object
Constructor Details
#initialize(config) ⇒ Config
Returns a new instance of Config.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jekyll_tagger/config.rb', line 5 def initialize(config) @config = config @include = value( 'include' , [] ) @exclude = value( 'exclude' , [] ) @indexes = value( 'indexes' , [] ) @names = value( 'names' , {} ) @slugs = value( 'slugs' , {} ) @types = value( 'types' , ['page' , 'feed'] ) @style = value( 'style' , 'pretty' ) @layouts = value( 'layouts' , {} ) @folders = value( 'folders' , {} ) @page_size = value( 'page_size' , 0 ) @page_show = value( 'page_show' , 5 ) @post_order= value( 'post_order', "descending" ) @pretty = @style == 'pretty' end |
Instance Attribute Details
#exclude ⇒ Object
Returns the value of attribute exclude.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def exclude @exclude end |
#folders ⇒ Object
Returns the value of attribute folders.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def folders @folders end |
#include ⇒ Object
Returns the value of attribute include.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def include @include end |
#indexes ⇒ Object
Returns the value of attribute indexes.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def indexes @indexes end |
#layouts ⇒ Object
Returns the value of attribute layouts.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def layouts @layouts end |
#names ⇒ Object
Returns the value of attribute names.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def names @names end |
#page_show ⇒ Object
Returns the value of attribute page_show.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def page_show @page_show end |
#page_size ⇒ Object
Returns the value of attribute page_size.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def page_size @page_size end |
#post_order ⇒ Object
Returns the value of attribute post_order.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def post_order @post_order end |
#pretty ⇒ Object
Returns the value of attribute pretty.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def pretty @pretty end |
#slugs ⇒ Object
Returns the value of attribute slugs.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def slugs @slugs end |
#style ⇒ Object
Returns the value of attribute style.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def style @style end |
#types ⇒ Object
Returns the value of attribute types.
3 4 5 |
# File 'lib/jekyll_tagger/config.rb', line 3 def types @types end |
Instance Method Details
#value(key, default) ⇒ Object
22 23 24 |
# File 'lib/jekyll_tagger/config.rb', line 22 def value(key,default) @config[key] || default end |