Rabl.host
Allows config options to be read like a hash
@param [Symbol] option Key for a given attribute
# File lib/rabl/configuration.rb, line 104 def [](option) __send__(option) end
@return the Bson encoder/engine to use.
# File lib/rabl/configuration.rb, line 91 def bson_engine @bson_engine || ::BSON end
Returns merged default and inputted xml options
# File lib/rabl/configuration.rb, line 109 def default_xml_options @_default_xml_options ||= @xml_options.reverse_merge(DEFAULT_XML_OPTIONS) end
@return The JSON engine used to encode Rabl templates into JSON
# File lib/rabl/configuration.rb, line 79 def json_engine get_json_engine end
@param [Symbol, String, encode] engine_name The name of a JSON engine,
or class that responds to %xencode`, to use to encode Rabl templates into JSON. For more details, see the MultiJson gem.
# File lib/rabl/configuration.rb, line 71 def json_engine=(engine_name_or_class) @engine_name = engine_name_or_class # multi_json compatibility TODO MultiJson.respond_to?(:use) ? MultiJson.use(@engine_name) : MultiJson.engine = @engine_name end
@return the MessagePack encoder/engine to use.
# File lib/rabl/configuration.rb, line 85 def msgpack_engine @msgpack_engine || ::MessagePack end
@return the Plist encoder/engine to use.
# File lib/rabl/configuration.rb, line 97 def plist_engine @plist_engine || ::Plist::Emit end
# File lib/rabl/configuration.rb, line 46 def initialize @include_json_root = true @include_child_root = true @include_msgpack_root = true @include_plist_root = true @include_xml_root = false @include_bson_root = true @enable_json_callbacks = false @bson_check_keys = false @bson_move_id = false @json_engine = nil @msgpack_engine = nil @bson_engine = nil @plist_engine = nil @xml_options = {} @cache_sources = false @cache_all_output = false @escape_all_output = false @view_paths = [] @cache_engine = Rabl::CacheEngine.new end