Class: JSON::Generator::AttributeFactory
- Inherits:
-
Object
- Object
- JSON::Generator::AttributeFactory
- Defined in:
- lib/json/generator/attribute_factory.rb
Constant Summary collapse
- CLASSES =
{ 'string' => StringAttribute, 'object' => ObjectAttribute, 'integer' => IntegerAttribute, 'array' => ArrayAttribute, 'boolean' => BooleanAttribute, 'number' => NumberAttribute, }
Class Method Summary collapse
Class Method Details
.create(properties) ⇒ Object
16 17 18 |
# File 'lib/json/generator/attribute_factory.rb', line 16 def self.create(properties) CLASSES[Array(properties['type']).first].new(properties) end |