Class: Swagger::Grape::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-swagger/grape/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Type

Returns a new instance of Type.



9
10
11
# File 'lib/ruby-swagger/grape/type.rb', line 9

def initialize(type)
  @type = type.to_s || 'String'
end

Instance Attribute Details

#discovered_typesObject (readonly)

needed?



7
8
9
# File 'lib/ruby-swagger/grape/type.rb', line 7

def discovered_types
  @discovered_types
end

Instance Method Details

#sub_typesObject



17
18
19
# File 'lib/ruby-swagger/grape/type.rb', line 17

def sub_types
  Swagger::Grape::Entity.new(@type).sub_types
end

#to_swagger(with_definition = true) ⇒ Object



13
14
15
# File 'lib/ruby-swagger/grape/type.rb', line 13

def to_swagger(with_definition = true)
  translate(with_definition)
end