Class: Pattana::Api::V1::DocsController

Inherits:
Pattana::ApplicationController show all
Defined in:
app/controllers/pattana/api/v1/docs_controller.rb

Instance Method Summary collapse

Instance Method Details

#cities_in_a_countryObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'app/controllers/pattana/api/v1/docs_controller.rb', line 62

def cities_in_a_country
  set_title("Cities API (in a country)")
  @request_type = "GET"
  @end_point = "/api/v1/countries/:country_id/cities"
  @description = ""
  @description = "  This API will return all the cities in a particular country. <br>\n  The Country ID has to be passed. <br>\n  This API can also be used to search cities in a country by passing a query parameter 'q'.\n  eos\n\n  @info = \"It will return only those cities who has show_in_api set true\"\n\n  @input_headers = {\n    \"Content-Type\" => { value: \"application/json\", description: \"The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. \" }\n  }\n\n  @input_params = {\n    country_id: { mandatory: true, description: \"The Country ID. You will get it from the Countries API\", example: \"for e.g: Country Id for U.A.E is 235 and that of India is 100\", default: \"\" }\n  }\n\n  @example_path = \"pattana/api/v1/docs/\"\n  @examples = [\"pos_case_1\", \"pos_case_2\", \"pos_case_3\", \"pos_case_4\", \"neg_case_1\"]\n\n  set_nav(\"docs/pattana/cities_in_a_country\")\n\n  render 'kuppayam/api/docs/show'\nend\n"

#cities_in_a_regionObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'app/controllers/pattana/api/v1/docs_controller.rb', line 91

def cities_in_a_region
  set_title("Cities API (in a region)")
  @request_type = "GET"
  @end_point = "/api/v1/regions/:region_id/cities"
  @description = "  This API will return all the cities in a particular region. <br>\n  The Region ID has to be passed. <br>\n  This API can also be used to search cities in a region by passing a query parameter 'q'.\n  eos\n\n  @info = \"It will return only those cities who has show_in_api set true\"\n  \n  @input_headers = {\n    \"Content-Type\" => { value: \"application/json\", description: \"The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. \" }\n  }\n\n  @input_params = {\n    country_id: { mandatory: true, description: \"The Country ID. You will get it from the Countries API\", example: \"for e.g: Country Id for U.A.E is 235 and that of India is 100\", default: \"\" },\n    region_id: { mandatory: true, description: \"The Region ID. You will get it from the Regions API\", example: \"for e.g: Country Id for India is 100 and Region ID for Kerala is 1314\", default: \"\" }\n  }\n\n  @example_path = \"pattana/api/v1/docs/\"\n  @examples = [\"pos_case_1\", \"pos_case_2\", \"pos_case_3\", \"pos_case_4\", \"neg_case_1\"]\n\n  set_nav(\"docs/pattana/cities_in_a_region\")\n\n  render 'kuppayam/api/docs/show'\nend\n"

#countriesObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/pattana/api/v1/docs_controller.rb', line 11

def countries
  set_title("Countries API")
  @request_type = "GET"
  @end_point = "/api/v1/countries"
  @description = "  This API will return all the countries with other details like dialing prefix and ISO codes. <br>\n  This API can also be used to search countries by passing a query parameter 'q'.<br>\n  eos\n\n  @info = \"It will return only those countries who has show_in_api set true\"\n\n  @input_headers = {\n    \"Content-Type\" => { value: \"application/json\", description: \"The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. \" }\n  }\n\n  @example_path = \"pattana/api/v1/docs/\"\n  @examples = [\"pos_case_1\", \"pos_case_2\", \"pos_case_3\", \"pos_case_4\"]\n\n  set_nav(\"docs/pattana/countries\")\n\n  render 'kuppayam/api/docs/show'\nend\n"

#regionsObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'app/controllers/pattana/api/v1/docs_controller.rb', line 34

def regions
  set_title("Regions API")
  @request_type = "GET"
  @end_point = "/api/v1/:country_id/regions"
  @description = "  This API will return all the regions in a particular country. <br>\n  The Country ID has to be passed. <br>\n  This API can also be used to search regions by passing a query parameter 'q'.\n  eos\n\n  @info = \"It will return only those regions who has show_in_api set true\"\n\n  @input_headers = {\n    \"Content-Type\" => { value: \"application/json\", description: \"The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. \" }\n  }\n\n  @input_params = {\n    country_id: { mandatory: true, description: \"The Country ID. You will get it from the Countries API\", example: \"for e.g: Country Id for U.A.E is 235 and that of India is 100\", default: \"\" }\n  }\n\n  @example_path = \"pattana/api/v1/docs/\"\n  @examples = [\"pos_case_1\", \"pos_case_2\", \"pos_case_3\", \"pos_case_4\", \"neg_case_1\"]\n\n  set_nav(\"docs/pattana/regions\")\n\n  render 'kuppayam/api/docs/show'\nend\n"