api_canon 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +28 -10
- data/lib/api_canon/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fa91521da7d5fd5b48562111c5d99d83bb69a3f
|
4
|
+
data.tar.gz: 65e021ee8670382922e8211367dd53fa2e9a5df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23746edbb6ce43120aed1fd73b374dee09865390eed1810364fd46a5864e1a81d2506ad98a7fe0c3ed13d3ee96a36469cf38fbd4659185c43ff4eba1abc94a1e
|
7
|
+
data.tar.gz: 33f3ae296a40dc414ad5cbf8871ad2d6d56227a3ebdc4bae5f6d63b0a60d4025082513fa0070a4e350c3c6ae1342ddb06d56945779920630b3baad57edb232a1
|
data/README.md
CHANGED
@@ -21,7 +21,8 @@ include ApiCanon
|
|
21
21
|
|
22
22
|
```ruby
|
23
23
|
document_controller :as => 'optional_rename' do
|
24
|
-
describe
|
24
|
+
describe %Q{The actions here are awesome, they allow you to get a list of
|
25
|
+
awesome things, and make awesome things, too!}
|
25
26
|
end
|
26
27
|
```
|
27
28
|
|
@@ -31,7 +32,10 @@ More usefully you can document all the actions you want like this:
|
|
31
32
|
|
32
33
|
```ruby
|
33
34
|
document_method :index do
|
34
|
-
param :category_codes, :type => :array, :multiple => true,
|
35
|
+
param :category_codes, :type => :array, :multiple => true,
|
36
|
+
:example_values => Category.limit(5).pluck(:code),
|
37
|
+
:description => "Return only categories for the given category codes",
|
38
|
+
:default => 'some-awesome-category-code'
|
35
39
|
end
|
36
40
|
```
|
37
41
|
|
@@ -56,8 +60,11 @@ class CategoriesController < ApplicationController
|
|
56
60
|
|
57
61
|
document_method :index do
|
58
62
|
describe "This gives you a bunch of categories."
|
59
|
-
param :node, :type => :string, :
|
60
|
-
|
63
|
+
param :node, :type => :string, :default => 'womens-fashion',
|
64
|
+
:values => ['womens-fashion', 'mens-fashion'],
|
65
|
+
:description => "Category code to start with"
|
66
|
+
param :depth, :type => :integer, :values => 1..4, :default => 1,
|
67
|
+
:description => "Maximum depth to include child categories"
|
61
68
|
end
|
62
69
|
def index
|
63
70
|
# Do stuff.
|
@@ -86,18 +93,29 @@ class FunkyCategoriesController < ApplicationController
|
|
86
93
|
include ApiCanon
|
87
94
|
|
88
95
|
document_controller :as => 'Categories' do
|
89
|
-
describe
|
96
|
+
describe %Q{Categories are used for filtering products. They are
|
97
|
+
hierarchical, with 4 levels. Examples include "Women's Fashion",
|
98
|
+
"Shirts" and so forth. They are uniquely identifiable by their
|
99
|
+
category_code field.}
|
90
100
|
end
|
91
101
|
|
92
102
|
document_method :index do
|
93
|
-
describe
|
94
|
-
|
95
|
-
param :
|
103
|
+
describe %Q{This action returns a filtered tree of categories based on the
|
104
|
+
parameters given in the request.}
|
105
|
+
param :hierarchy_level, :values => 1..4, :type => :integer, :default => 1,
|
106
|
+
:description => "Maximum depth to include child categories"
|
107
|
+
param :category_codes, :type => :array, :multiple => true,
|
108
|
+
:example_values => Category.limit(5).pluck(:code),
|
109
|
+
:description => "Return only categories for the given category codes",
|
110
|
+
:default => 'mens-fashion-accessories'
|
96
111
|
end
|
97
112
|
|
98
113
|
document_method :show do
|
99
|
-
describe
|
100
|
-
|
114
|
+
describe %Q{This action returns a tree of categories starting at the
|
115
|
+
requested root node.}
|
116
|
+
param :id, :type => :string,:default => 'mens-fashion-accessories',
|
117
|
+
:example_values => Category.limit(5).pluck(:code),
|
118
|
+
:description => "Category code to show, the root node for the entire tree."
|
101
119
|
end
|
102
120
|
|
103
121
|
#... code to support the above documented parameters etc.
|
data/lib/api_canon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_canon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Walsh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: redcarpet
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '>='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
description: |-
|
84
70
|
api_canon is a declarative documentation generator
|
85
71
|
for APIs. Declare the parameters and response codes,
|