Class: Swagger::Schema::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger/schema/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ Component

Returns a new instance of Component.



8
9
10
# File 'lib/swagger/schema/component.rb', line 8

def initialize(schema)
  @schema = schema
end

Instance Attribute Details

#schemaObject (readonly)

Returns the value of attribute schema.



6
7
8
# File 'lib/swagger/schema/component.rb', line 6

def schema
  @schema
end

Instance Method Details

#serializer(options = {}, store = true) ⇒ Object



12
13
14
15
# File 'lib/swagger/schema/component.rb', line 12

def serializer(options = {}, store = true)
  use_options = store ? Swagger::Serializer::Store.current.serialize_options.merge(options) : options
  JSON::Schema::Serializer.new(@schema, use_options)
end