Class: Swagger::Docs::ApiDeclarationFile

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger/docs/api_declaration_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata, apis, models) ⇒ ApiDeclarationFile

Returns a new instance of ApiDeclarationFile.



6
7
8
9
10
# File 'lib/swagger/docs/api_declaration_file.rb', line 6

def initialize(, apis, models)
  @metadata = 
  @apis = camelize_keys_deep apis
  @models = models
end

Instance Attribute Details

#apisObject (readonly)

Returns the value of attribute apis.



4
5
6
# File 'lib/swagger/docs/api_declaration_file.rb', line 4

def apis
  @apis
end

#metadataObject (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/swagger/docs/api_declaration_file.rb', line 4

def 
  @metadata
end

Instance Method Details

#api_versionObject



31
32
33
# File 'lib/swagger/docs/api_declaration_file.rb', line 31

def api_version
  .api_version
end

#authorizationsObject



55
56
57
# File 'lib/swagger/docs/api_declaration_file.rb', line 55

def authorizations
  .authorizations
end

#base_pathObject



19
20
21
# File 'lib/swagger/docs/api_declaration_file.rb', line 19

def base_path
  .base_path
end

#camelize_model_propertiesObject



39
40
41
# File 'lib/swagger/docs/api_declaration_file.rb', line 39

def camelize_model_properties
  .camelize_model_properties
end

#controller_base_pathObject



35
36
37
# File 'lib/swagger/docs/api_declaration_file.rb', line 35

def controller_base_path
  .controller_base_path
end

#generate_resourceObject



12
13
14
15
16
17
# File 'lib/swagger/docs/api_declaration_file.rb', line 12

def generate_resource
  resource = build_resource_root_hash
  # Add the already-normalized models to the resource.
  resource = resource.merge({:models => models}) if models.present?
  resource
end

#modelsObject



51
52
53
# File 'lib/swagger/docs/api_declaration_file.rb', line 51

def models
  normalize_model_properties @models
end

#pathObject



23
24
25
# File 'lib/swagger/docs/api_declaration_file.rb', line 23

def path
  .path
end

#resource_file_pathObject



47
48
49
# File 'lib/swagger/docs/api_declaration_file.rb', line 47

def resource_file_path
  trim_leading_slash(debased_path.to_s.underscore)
end

#resource_pathObject



43
44
45
# File 'lib/swagger/docs/api_declaration_file.rb', line 43

def resource_path
  .overridden_resource_path || demod
end

#swagger_versionObject



27
28
29
# File 'lib/swagger/docs/api_declaration_file.rb', line 27

def swagger_version
  .swagger_version
end