Class: Rabl::Configuration
- Inherits:
-
Object
- Object
- Rabl::Configuration
- Defined in:
- lib/rabl/configuration.rb
Overview
Rabl.host
Constant Summary collapse
- DEFAULT_XML_OPTIONS =
{ :dasherize => true, :skip_types => false }
Instance Attribute Summary collapse
-
#enable_json_callbacks ⇒ Object
Returns the value of attribute enable_json_callbacks.
-
#include_json_root ⇒ Object
Returns the value of attribute include_json_root.
-
#include_xml_root ⇒ Object
Returns the value of attribute include_xml_root.
-
#xml_options ⇒ Object
writeonly
Sets the attribute xml_options.
Instance Method Summary collapse
-
#[](option) ⇒ Object
Allows config options to be read like a hash.
-
#default_xml_options ⇒ Object
Returns merged default and inputted xml options.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 |
# File 'lib/rabl/configuration.rb', line 11 def initialize @include_json_root = true @include_xml_root = false @enable_json_callbacks = false = {} end |
Instance Attribute Details
#enable_json_callbacks ⇒ Object
Returns the value of attribute enable_json_callbacks.
6 7 8 |
# File 'lib/rabl/configuration.rb', line 6 def enable_json_callbacks @enable_json_callbacks end |
#include_json_root ⇒ Object
Returns the value of attribute include_json_root.
4 5 6 |
# File 'lib/rabl/configuration.rb', line 4 def include_json_root @include_json_root end |
#include_xml_root ⇒ Object
Returns the value of attribute include_xml_root.
5 6 7 |
# File 'lib/rabl/configuration.rb', line 5 def include_xml_root @include_xml_root end |
#xml_options=(value) ⇒ Object (writeonly)
Sets the attribute xml_options
7 8 9 |
# File 'lib/rabl/configuration.rb', line 7 def (value) = value end |
Instance Method Details
#[](option) ⇒ Object
Allows config options to be read like a hash
21 22 23 |
# File 'lib/rabl/configuration.rb', line 21 def [](option) send(option) end |
#default_xml_options ⇒ Object
Returns merged default and inputted xml options
26 27 28 |
# File 'lib/rabl/configuration.rb', line 26 def ||= .reverse_merge(DEFAULT_XML_OPTIONS) end |