Class: SupplejackApi::SchemaDefinition::SchemaObject

Inherits:
Object
  • Object
show all
Defined in:
app/models/supplejack_api/schema_definition.rb

Direct Known Subclasses

Field, Group, ModelField, MongoIndex, Namespace, Role

Defined Under Namespace

Classes: SchemaObjectBuilder

Constant Summary collapse

ALLOWED_ATTRIBUTES =
ALLOWED_ATTRIBUTES.values.flatten

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options, &block) ⇒ SchemaObject

Returns a new instance of SchemaObject.


90
91
92
93
94
95
96
97
# File 'app/models/supplejack_api/schema_definition.rb', line 90

def initialize(name, options, &block)
  @name = name

  builder = SchemaObjectBuilder.new(options)
  builder.instance_eval(&block) if block_given?

  @options = builder.options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


88
89
90
# File 'app/models/supplejack_api/schema_definition.rb', line 88

def name
  @name
end