Class: Jekyll_Tagger::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#excludeObject

Returns the value of attribute exclude.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def exclude
  @exclude
end

#foldersObject

Returns the value of attribute folders.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def folders
  @folders
end

#includeObject

Returns the value of attribute include.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def include
  @include
end

#indexesObject

Returns the value of attribute indexes.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def indexes
  @indexes
end

#layoutsObject

Returns the value of attribute layouts.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def layouts
  @layouts
end

#namesObject

Returns the value of attribute names.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def names
  @names
end

#page_showObject

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_sizeObject

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_orderObject

Returns the value of attribute post_order.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def post_order
  @post_order
end

#prettyObject

Returns the value of attribute pretty.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def pretty
  @pretty
end

#slugsObject

Returns the value of attribute slugs.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def slugs
  @slugs
end

#styleObject

Returns the value of attribute style.



3
4
5
# File 'lib/jekyll_tagger/config.rb', line 3

def style
  @style
end

#typesObject

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