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.



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

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
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

#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



30
31
32
# File 'lib/hensel/configuration.rb', line 30

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

#[]=(key, value) ⇒ Object



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

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