Module: DataBindings::Adapters::BSON

Includes:
Ruby, GemRequirement
Defined in:
lib/data_bindings/adapters/bson.rb

Defined Under Namespace

Modules: Convert

Instance Method Summary collapse

Methods included from GemRequirement

gentle_require_gem, included

Methods included from Ruby

#from_ruby, #from_ruby_array, #from_ruby_hash

Instance Method Details

#from_bson(str) ⇒ RubyObjectAdapter, RubyArrayAdapter

Constructs a wrapped object from a JSON string

Parameters:

  • str (String)

    The JSON object

Returns:



10
11
12
# File 'lib/data_bindings/adapters/bson.rb', line 10

def from_bson(str)
  from_ruby(::BSON.deserialize(str.unpack("C*")))
end