Class: Hensel::Configuration
- Inherits:
-
Object
- Object
- Hensel::Configuration
- Defined in:
- lib/hensel/configuration.rb
Instance Attribute Summary collapse
-
#attr_wrapper ⇒ Object
Returns the value of attribute attr_wrapper.
-
#before_load ⇒ Object
Returns the value of attribute before_load.
-
#default_item_options ⇒ Object
Returns the value of attribute default_item_options.
-
#parent_attributes ⇒ Object
Returns the value of attribute parent_attributes.
-
#parent_element ⇒ Object
Returns the value of attribute parent_element.
-
#richsnippet ⇒ Object
Returns the value of attribute richsnippet.
-
#whitespace ⇒ Object
Returns the value of attribute whitespace.
Class Method Summary collapse
-
.attr_boolean_accessor(*keys) ⇒ Object
Define the accessor as boolean method.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_wrapper ⇒ Object
Returns the value of attribute attr_wrapper.
16 17 18 |
# File 'lib/hensel/configuration.rb', line 16 def attr_wrapper @attr_wrapper end |
#before_load ⇒ Object
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_options ⇒ Object
Returns the value of attribute default_item_options.
16 17 18 |
# File 'lib/hensel/configuration.rb', line 16 def @default_item_options end |
#parent_attributes ⇒ Object
Returns the value of attribute parent_attributes.
16 17 18 |
# File 'lib/hensel/configuration.rb', line 16 def parent_attributes @parent_attributes end |
#parent_element ⇒ Object
Returns the value of attribute parent_element.
16 17 18 |
# File 'lib/hensel/configuration.rb', line 16 def parent_element @parent_element end |
#richsnippet ⇒ Object
Returns the value of attribute richsnippet.
16 17 18 |
# File 'lib/hensel/configuration.rb', line 16 def richsnippet @richsnippet end |
#whitespace ⇒ Object
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 |