Module: NoBrainer::Binary::NoBrainerExtensions

Included in:
NoBrainer::Binary
Defined in:
lib/no_brainer/document/types/binary.rb

Constant Summary collapse

InvalidType =
NoBrainer::Error::InvalidType

Instance Method Summary collapse

Instance Method Details

#nobrainer_cast_user_to_model(value) ⇒ Object



10
11
12
13
14
15
# File 'lib/no_brainer/document/types/binary.rb', line 10

def nobrainer_cast_user_to_model(value)
  case value
  when String then RethinkDB::Binary.new(value)
  else raise InvalidType
  end
end