Method: Backdat::Config.from_stream_json

Defined in:
lib/backdat/config.rb

.from_stream_json(input) ⇒ Object

Loads a given json input and merges the current context configuration with the updated hash.

Parameters:

  • input (String)

    The json configuration input.

Raises:

  • (IOError)

    Any IO Exceptions that occur.

  • (Yajl::ParseError)

    Raises Yajl Parsing error on improper json.



51
52
53
54
# File 'lib/backdat/config.rb', line 51

def self.from_stream_json(input)
  parser = Yajl::Parser.new(:symbolize_keys => true)
  configuration.merge!(parser.parse(input))
end