Class: Swagger::Grape::Type
- Inherits:
-
Object
- Object
- Swagger::Grape::Type
- Defined in:
- lib/ruby-swagger/grape/type.rb
Instance Attribute Summary collapse
-
#discovered_types ⇒ Object
readonly
needed?.
Instance Method Summary collapse
-
#initialize(type) ⇒ Type
constructor
A new instance of Type.
- #sub_types ⇒ Object
- #to_swagger(with_definition = true) ⇒ Object
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_types ⇒ Object (readonly)
needed?
7 8 9 |
# File 'lib/ruby-swagger/grape/type.rb', line 7 def discovered_types @discovered_types end |
Instance Method Details
#sub_types ⇒ Object
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 |