Class: Apipie::Generator::Swagger::ReferencedDefinitions

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/apipie/generator/swagger/referenced_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReferencedDefinitions

Returns a new instance of ReferencedDefinitions.



6
7
8
# File 'lib/apipie/generator/swagger/referenced_definitions.rb', line 6

def initialize
  @definitions = {}
end

Instance Attribute Details

#definitionsObject (readonly)

Returns the value of attribute definitions.



4
5
6
# File 'lib/apipie/generator/swagger/referenced_definitions.rb', line 4

def definitions
  @definitions
end

Instance Method Details

#add!(param_type, schema) ⇒ Object



10
11
12
# File 'lib/apipie/generator/swagger/referenced_definitions.rb', line 10

def add!(param_type, schema)
  @definitions[param_type] = schema
end

#added?(name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/apipie/generator/swagger/referenced_definitions.rb', line 14

def added?(name)
  @definitions.key?(name)
end