Module: JSONModel
- Defined in:
- lib/jsonmodel.rb,
lib/jsonmodel/naming.rb
Defined Under Namespace
Modules: Attributes, Naming, Persistence, Validations Classes: Base
Constant Summary collapse
- Types =
{ "string" => String, "integer" => [Integer, Fixnum], "number" => [Integer, Float, Fixnum, Numeric], "boolean" => [TrueClass, FalseClass], "object" => Hash, "array" => Array, "null" => NilClass, "any" => nil }
Class Method Summary collapse
Class Method Details
.from_hash(schema) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jsonmodel.rb', line 23 def self.from_hash(schema) Class.new(Base) do self.schema = schema include JSONModel::Attributes include JSONModel::Validations include JSONModel::Naming end end |