Class: Restspec::Schema::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/restspec/schema/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#schemasObject (readonly)

Returns the value of attribute schemas.



4
5
6
# File 'lib/restspec/schema/dsl.rb', line 4

def schemas
  @schemas
end

Instance Method Details

#schema(name, &definition) ⇒ Object



6
7
8
9
10
# File 'lib/restspec/schema/dsl.rb', line 6

def schema(name, &definition)
  dsl = SingleSchemaDSL.new(name)
  dsl.instance_eval(&definition)
  Restspec::SchemaStore.store(dsl.schema)
end