Module: Aws::Json Private
- Defined in:
- lib/aws-sdk-core/json.rb,
lib/aws-sdk-core/json/parser.rb,
lib/aws-sdk-core/json/builder.rb,
lib/aws-sdk-core/json/handler.rb,
lib/aws-sdk-core/json/oj_engine.rb,
lib/aws-sdk-core/json/json_engine.rb,
lib/aws-sdk-core/json/error_handler.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: JsonEngine, OjEngine Classes: Builder, ErrorHandler, Handler, ParseError, Parser
Class Method Summary collapse
- .dump(value) ⇒ Object private
-
.engine ⇒ Class
private
Returns the default engine.
- .engine=(engine) ⇒ Object private
- .load(json) ⇒ Object private
- .set_default_engine ⇒ Object private
Class Method Details
.dump(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/aws-sdk-core/json.rb', line 46 def dump(value) @engine.dump(value) end |
.engine ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the default engine. One of:
37 38 39 40 |
# File 'lib/aws-sdk-core/json.rb', line 37 def engine set_default_engine unless @engine @engine end |
.engine=(engine) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/aws-sdk-core/json.rb', line 27 def engine=(engine) @engine = Class === engine ? engine : load_engine(engine) end |
.load(json) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/aws-sdk-core/json.rb', line 42 def load(json) @engine.load(json) end |
.set_default_engine ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/aws-sdk-core/json.rb', line 50 def set_default_engine [:oj, :json].each do |name| @engine ||= try_load_engine(name) end unless @engine raise 'Unable to find a compatible json library. ' \ 'Ensure that you have installed or added to your Gemfile one of ' \ 'oj or json' end end |