Class: Hensel::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hensel/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/hensel/configuration.rb', line 19

def initialize
  @bootstrap            = false
  @escape_html          = true
  @indentation          = true
  @last_item_link       = false
  @richsnippet          = :microdata # [:microdata, :rdfa, :nil]
  @attr_wrapper         = "'"
  @whitespace           = "  "
  @parent_element       = :ul 
  @before_load          = nil
  @default_item_options = {}
  @parent_attributes    = {}
end

Instance Attribute Details

#attr_wrapperObject

Returns the value of attribute attr_wrapper.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def attr_wrapper
  @attr_wrapper
end

#before_loadObject

Returns the value of attribute before_load.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def before_load
  @before_load
end

#default_item_optionsObject

Returns the value of attribute default_item_options.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def default_item_options
  @default_item_options
end

#parent_attributesObject

Returns the value of attribute parent_attributes.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def parent_attributes
  @parent_attributes
end

#parent_elementObject

Returns the value of attribute parent_element.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def parent_element
  @parent_element
end

#richsnippetObject

Returns the value of attribute richsnippet.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def richsnippet
  @richsnippet
end

#whitespaceObject

Returns the value of attribute whitespace.



16
17
18
# File 'lib/hensel/configuration.rb', line 16

def whitespace
  @whitespace
end

Class Method Details

.attr_boolean_accessor(*keys) ⇒ Object

Define the accessor as boolean method



4
5
6
7
8
9
# File 'lib/hensel/configuration.rb', line 4

def self.attr_boolean_accessor(*keys)
  keys.each do |key|
    attr_accessor key
    define_method("#{key}?"){ !!__send__(key) }
  end
end

Instance Method Details

#[](key) ⇒ Object



33
34
35
# File 'lib/hensel/configuration.rb', line 33

def [](key)
  instance_variable_get(:"@#{key}")
end

#[]=(key, value) ⇒ Object



37
38
39
# File 'lib/hensel/configuration.rb', line 37

def []=(key, value)
  instance_variable_set(:"@#{key}", value)
end