voog_api 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7f44b299ce7547c3f02afb6ef7c359dc1bb227f
4
- data.tar.gz: a11ac4014716a5123f0402e32dc7dbd43b468a47
3
+ metadata.gz: 5214de3595e958aad72ee6f7b4a903e9075c244b
4
+ data.tar.gz: 49269b2431b5f8479c771daca4d90517546f6ffa
5
5
  SHA512:
6
- metadata.gz: c2a7313731a067a53d33b31c39c5d0940dc53d6a150781562850ac46a2e08a937d2c2324e5fe048e46f51dfc1b4410753ecebc5167da3400463686b018d9f0fb
7
- data.tar.gz: 31553dcd752fad8a075132e403a50e6df4552b4ca8f2ddc3547ce33688e569b81c67baaf4a9f9a6241507a8972ae00f55d8774e9c6b4b06bfca6fa205edc7624
6
+ metadata.gz: 69dad9289d6822fb6471850f964f0d7ca29d62b4e19d82a6f24f8b35934c501a0e6e0d3be0b17be15e17d6c9f44db1d3231d92f07914314e7115bedb023da69a
7
+ data.tar.gz: 96db417ebda65df346de469ad4e17fd437d92ca255d42e2d7ecc3122ba9e9ecd999597345b3862632d490d0b91c52b75b9b61d00d621d8b0a136cccafe043098
@@ -1,33 +1,49 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Articles API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/articles
3
7
  module Articles
4
8
 
5
9
  # List articles
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/articles#get_articles
6
12
  def articles(params = {})
7
13
  paginate 'articles', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single article
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/articles#get_article
11
19
  def article(id, params = {})
12
20
  get "articles/#{id}", {query: params}
13
21
  end
14
22
 
15
- # Create a article
23
+ # Create an article
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/articles#create_article
16
26
  def create_article(data)
17
27
  post 'articles', data
18
28
  end
19
29
 
20
- # Update a article
30
+ # Update an article
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/articles#update_article
21
33
  def update_article(id, data)
22
34
  put "articles/#{id}", data
23
35
  end
24
36
 
25
- # Patch a article
37
+ # Patch an article
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/articles#patch_article
26
40
  def patch_article(id, data)
27
41
  patch "articles/#{id}", data
28
42
  end
29
43
 
30
- # Delete a article
44
+ # Delete an article
45
+ #
46
+ # @see http://www.voog.com/developers/api/resources/articles#remove_article
31
47
  def delete_article(id)
32
48
  delete "articles/#{id}"
33
49
  end
@@ -35,6 +51,8 @@ module Voog
35
51
  # Update/create a key in article data field
36
52
  #
37
53
  # @param id [String] key in data field
54
+ #
55
+ # @see http://www.voog.com/developers/api/resources/articles#update_article_data_field
38
56
  def update_article_data(article_id, id, data)
39
57
  put "articles/#{article_id}/data/#{id}", {value: data}
40
58
  end
@@ -42,6 +60,8 @@ module Voog
42
60
  # Delete a key from article data field
43
61
  #
44
62
  # @param id [String] key in data field
63
+ #
64
+ # @see http://www.voog.com/developers/api/resources/articles#delete_article_custom_field
45
65
  def delete_article_data(article_id, id)
46
66
  delete "articles/#{article_id}/data/#{id}"
47
67
  end
@@ -49,26 +69,36 @@ module Voog
49
69
  # Article contents
50
70
 
51
71
  # List contents for article
72
+ #
73
+ # @see http://www.voog.com/developers/api/resources/contents#get_contents
52
74
  def article_contents(id, params = {})
53
75
  contents(Voog::API::Contents::ParentKind::Article, id, params)
54
76
  end
55
77
 
56
78
  # Get a single content for article
79
+ #
80
+ # @see http://www.voog.com/developers/api/resources/contents#get_content
57
81
  def article_content(article_id, id, params = {})
58
82
  content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
59
83
  end
60
84
 
61
- # Create a article content for article
85
+ # Create an article content for article
86
+ #
87
+ # @see http://www.voog.com/developers/api/resources/contents#create_content
62
88
  def create_article_content(article_id, data)
63
89
  create_content(Voog::API::Contents::ParentKind::Article, article_id, data)
64
90
  end
65
91
 
66
92
  # Delete a content from article
93
+ #
94
+ # @see http://www.voog.com/developers/api/resources/contents#delete_content
67
95
  def delete_article_content(article_id, id)
68
96
  delete_content(Voog::API::Contents::ParentKind::Article, article_id, id)
69
97
  end
70
98
 
71
99
  # Reorder/move article content inside/between content areas and parent objects
100
+ #
101
+ # @see http://www.voog.com/developers/api/resources/contents#relocate_content
72
102
  def move_article_content(article_id, id, params = {})
73
103
  move_content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
74
104
  end
@@ -1,28 +1,42 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Assets API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/assets
3
7
  module Assets
4
8
 
5
9
  # List assets
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/assets#get_assets
6
12
  def assets(params = {})
7
13
  paginate 'assets', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single asset
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/assets#get_asset
11
19
  def asset(id, params = {})
12
20
  get "assets/#{id}", {query: params}
13
21
  end
14
22
 
15
- # Create a asset
23
+ # Create an asset
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/assets#create_asset
16
26
  def create_asset(data)
17
27
  post 'assets', data
18
28
  end
19
29
 
20
- # Confirm a asset upload
30
+ # Confirm an asset upload
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/assets#confirm_asset
21
33
  def confirm_asset(id)
22
34
  put "assets/#{id}/confirm", nil
23
35
  end
24
36
 
25
- # Delete a asset
37
+ # Delete an asset
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/assets#remove_asset
26
40
  def delete_asset(id)
27
41
  delete "assets/#{id}"
28
42
  end
@@ -1,33 +1,49 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog article Comments API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/comments
3
7
  module Comments
4
8
 
5
9
  # List article comments
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/comments#get_comments
6
12
  def comments(article_id, params = {})
7
13
  paginate "articles/#{article_id}/comments", {query: params}
8
14
  end
9
15
 
10
16
  # Get a single comment for article
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/comments#get_comment
11
19
  def comment(article_id, id, params = {})
12
20
  get "articles/#{article_id}/comments/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a comment
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/comments#create_comment
16
26
  def create_comment(article_id, data)
17
27
  post "articles/#{article_id}/comments", data
18
28
  end
19
29
 
20
30
  # Toggle comment spam flag
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/comments#toggle_spam_comment
21
33
  def toggle_spam_comment(article_id, id)
22
34
  put "articles/#{article_id}/comments/#{id}/toggle_spam", nil
23
35
  end
24
36
 
25
- # Delete a article comment
37
+ # Delete an article comment
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/comments#remove_comment
26
40
  def delete_comment(article_id, id)
27
41
  delete "articles/#{article_id}/comments/#{id}"
28
42
  end
29
43
 
30
44
  # Delete all spam comment for article
45
+ #
46
+ # @see http://www.voog.com/developers/api/resources/comments#delete_spam_comments
31
47
  def delete_spam_comments(article_id)
32
48
  delete "articles/#{article_id}/comments/delete_spam"
33
49
  end
@@ -1,18 +1,28 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Content Partials API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/content_partials
3
7
  module ContentPartials
4
8
 
5
9
  # List content partials contents
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/content_partials#get_content_partials
6
12
  def content_partials(params = {})
7
13
  paginate 'content_partials', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single content partial content
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/content_partials#get_content_partial
11
19
  def content_partial(id, params = {})
12
20
  get "content_partials/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Update a content partial content
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/content_partials#update_content_partial
16
26
  def update_content_partial(id, data)
17
27
  put "content_partials/#{id}", data
18
28
  end
@@ -1,5 +1,9 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Contents API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/contents
3
7
  module Contents
4
8
 
5
9
  module ParentKind
@@ -10,26 +14,36 @@ module Voog
10
14
  end
11
15
 
12
16
  # List contents
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/contents#get_contents
13
19
  def contents(parent_name, parent_id, params = {})
14
20
  paginate "#{parent_name}/#{parent_id}/contents", {query: params}
15
21
  end
16
22
 
17
23
  # Get a single content
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/contents#get_content
18
26
  def content(parent_name, parent_id, id, params = {})
19
27
  get "#{parent_name}/#{parent_id}/contents/#{id}", {query: params}
20
28
  end
21
29
 
22
30
  # Create a content
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/contents#create_content
23
33
  def create_content(parent_name, parent_id, data)
24
34
  post "#{parent_name}/#{parent_id}/contents", data
25
35
  end
26
36
 
27
37
  # Delete a content
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/contents#delete_content
28
40
  def delete_content(parent_name, parent_id, id)
29
41
  delete "#{parent_name}/#{parent_id}/contents/#{id}"
30
42
  end
31
43
 
32
44
  # Reorder/move content inside/between content areas and parent objects
45
+ #
46
+ # @see http://www.voog.com/developers/api/resources/contents#relocate_content
33
47
  def move_content(parent_name, parent_id, id, params = {})
34
48
  put "#{parent_name}/#{parent_id}/contents/#{id}/move", nil, {query: params}
35
49
  end
@@ -1,28 +1,42 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Element Definitions API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/element_definitions
3
7
  module ElementDefinitions
4
8
 
5
9
  # List element_definitions
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/element_definitions#get_element_definitions
6
12
  def element_definitions(params = {})
7
13
  paginate 'element_definitions', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single element_definition
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/element_definitions#get_element_definition
11
19
  def element_definition(id, params = {})
12
20
  get "element_definitions/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a element_definition
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/element_definitions#create_element_definition
16
26
  def create_element_definition(data)
17
27
  post 'element_definitions', data
18
28
  end
19
29
 
20
30
  # Update a element_definition
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/element_definitions#update_element_definition
21
33
  def update_element_definition(id, data)
22
34
  put "element_definitions/#{id}", data
23
35
  end
24
36
 
25
37
  # Delete a element_definition
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/element_definitions#remove_element_definition
26
40
  def delete_element_definition(id)
27
41
  delete "element_definitions/#{id}"
28
42
  end
@@ -1,33 +1,49 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Element Definitions API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/elements
3
7
  module Elements
4
8
 
5
9
  # List elements
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/elements#get_elements
6
12
  def elements(params = {})
7
13
  paginate 'elements', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single element
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/elements#get_element
11
19
  def element(id, params = {})
12
20
  get "elements/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a element
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/elements#create_element
16
26
  def create_element(data)
17
27
  post 'elements', data
18
28
  end
19
29
 
20
30
  # Update a element
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/elements#update_element
21
33
  def update_element(id, data)
22
34
  put "elements/#{id}", data
23
35
  end
24
36
 
25
37
  # Delete a element
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/elements#remove_element
26
40
  def delete_element(id)
27
41
  delete "elements/#{id}"
28
42
  end
29
43
 
30
44
  # Reorder a elements
45
+ #
46
+ # @see http://www.voog.com/developers/api/resources/elements#move_element
31
47
  def move_element(element_id, params)
32
48
  put "elements/#{element_id}/move", nil, {query: params}
33
49
  end
@@ -35,26 +51,36 @@ module Voog
35
51
  # Element contents
36
52
 
37
53
  # List contents for element
54
+ #
55
+ # @see http://www.voog.com/developers/api/resources/contents#get_contents
38
56
  def element_contents(id, params = {})
39
57
  contents(Voog::API::Contents::ParentKind::Element, id, params)
40
58
  end
41
59
 
42
60
  # Get a single content for element
61
+ #
62
+ # @see http://www.voog.com/developers/api/resources/contents#get_content
43
63
  def element_content(element_id, id, params = {})
44
64
  content(Voog::API::Contents::ParentKind::Element, element_id, id, params)
45
65
  end
46
66
 
47
67
  # Create a element content for element
68
+ #
69
+ # @see http://www.voog.com/developers/api/resources/contents#create_content
48
70
  def create_element_content(element_id, data)
49
71
  create_content(Voog::API::Contents::ParentKind::Element, element_id, data)
50
72
  end
51
73
 
52
74
  # Delete a content from element
75
+ #
76
+ # @see http://www.voog.com/developers/api/resources/contents#delete_content
53
77
  def delete_element_content(element_id, id)
54
78
  delete_content(Voog::API::Contents::ParentKind::Element, element_id, id)
55
79
  end
56
80
 
57
81
  # Reorder/move element content inside/between content areas and parent objects
82
+ #
83
+ # @see http://www.voog.com/developers/api/resources/contents#relocate_content
58
84
  def move_element_content(element_id, id, params = {})
59
85
  move_content(Voog::API::Contents::ParentKind::Element, element_id, id, params)
60
86
  end
@@ -1,21 +1,38 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Forms API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/forms
3
7
  module Forms
4
8
 
5
9
  # List forms
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/forms#get_forms
6
12
  def forms(params = {})
7
13
  paginate 'forms', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single form
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/forms#get_form
11
19
  def form(id, params = {})
12
20
  get "forms/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Update a form
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/forms#update_form
16
26
  def update_form(id, data)
17
27
  put "forms/#{id}", data
18
28
  end
29
+
30
+ # Delete a form
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/forms#delete_form
33
+ def delete_form(id)
34
+ delete "forms/#{id}"
35
+ end
19
36
  end
20
37
  end
21
38
  end
@@ -1,38 +1,56 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Languages API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/languages
3
7
  module Languages
4
8
 
5
9
  # List languages
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/languages#get_languages
6
12
  def languages(params = {})
7
13
  paginate 'languages', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single language
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/languages#get_language
11
19
  def language(id, params = {})
12
20
  get "languages/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a language
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/languages#create_language
16
26
  def create_language(data)
17
27
  post 'languages', data
18
28
  end
19
29
 
20
30
  # Update a language
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/languages#update_language
21
33
  def update_language(id, data)
22
34
  put "languages/#{id}", data
23
35
  end
24
36
 
25
37
  # Delete a language
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/languages#remove_language
26
40
  def delete_language(id)
27
41
  delete "languages/#{id}"
28
42
  end
29
43
 
30
44
  # Reorder a language
45
+ #
46
+ # @see http://www.voog.com/developers/api/resources/languages#move_language
31
47
  def move_language(language_id, params)
32
48
  put "languages/#{language_id}/move", nil, {query: params}
33
49
  end
34
50
 
35
51
  # Enable language automatic detection for site visitors
52
+ #
53
+ # @see http://www.voog.com/developers/api/resources/languages#enable_autodetect
36
54
  def enable_language_autodetect
37
55
  put "languages/enable_autodetect", nil
38
56
  end
@@ -40,26 +58,36 @@ module Voog
40
58
  # Language contents
41
59
 
42
60
  # List contents for language
61
+ #
62
+ # @see http://www.voog.com/developers/api/resources/contents#get_contents
43
63
  def language_contents(id, params = {})
44
64
  contents(Voog::API::Contents::ParentKind::Language, id, params)
45
65
  end
46
66
 
47
67
  # Get a single content for language
68
+ #
69
+ # @see http://www.voog.com/developers/api/resources/contents#get_content
48
70
  def language_content(language_id, id, params = {})
49
71
  content(Voog::API::Contents::ParentKind::Language, language_id, id, params)
50
72
  end
51
73
 
52
74
  # Create a language content for language
75
+ #
76
+ # @see http://www.voog.com/developers/api/resources/contents#create_content
53
77
  def create_language_content(language_id, data)
54
78
  create_content(Voog::API::Contents::ParentKind::Language, language_id, data)
55
79
  end
56
80
 
57
81
  # Delete a content from language
82
+ #
83
+ # @see http://www.voog.com/developers/api/resources/contents#delete_content
58
84
  def delete_language_content(language_id, id)
59
85
  delete_content(Voog::API::Contents::ParentKind::Language, language_id, id)
60
86
  end
61
87
 
62
88
  # Reorder/move language content inside/between content areas and parent objects
89
+ #
90
+ # @see http://www.voog.com/developers/api/resources/contents#relocate_content
63
91
  def move_language_content(language_id, id, params = {})
64
92
  move_content(Voog::API::Contents::ParentKind::Language, language_id, id, params)
65
93
  end
@@ -1,18 +1,30 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Layout Assets API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/layout_assets
3
7
  module LayoutAssets
4
8
 
5
9
  # List layouts assets
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/layout_assets#get_layout_assets
6
12
  def layout_assets(params = {})
7
13
  paginate 'layout_assets', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single layout asset
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/layout_assets#get_layout_asset
11
19
  def layout_asset(id, params = {})
12
20
  get "layout_assets/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a layout asset
24
+ #
25
+ # @option data [String] :data file content (used only for text-based files, e.g. .css and .js files)
26
+ # @option data [String] :file path to file location (used for binary files only)
27
+ # @see http://www.voog.com/developers/api/resources/layout_assets#create_layout_asset
16
28
  def create_layout_asset(data)
17
29
  if data && data.key?(:file)
18
30
  data = data.dup
@@ -24,6 +36,8 @@ module Voog
24
36
  end
25
37
 
26
38
  # Update a layout asset
39
+ #
40
+ # @see http://www.voog.com/developers/api/resources/layout_assets#update_layout_asset
27
41
  def update_layout_asset(id, data)
28
42
  if data && data.key?(:file)
29
43
  data[:data] = File.read data.delete(:file)
@@ -32,6 +46,8 @@ module Voog
32
46
  end
33
47
 
34
48
  # Delete a layout asset
49
+ #
50
+ # @see http://www.voog.com/developers/api/resources/layout_assets#remove_layout_asset
35
51
  def delete_layout_asset(id)
36
52
  delete "layout_assets/#{id}"
37
53
  end
@@ -1,28 +1,42 @@
1
1
  module Voog
2
2
  class API
3
+
4
+ # Voog Layouts API methods.
5
+ #
6
+ # @see http://www.voog.com/developers/api/resources/layouts
3
7
  module Layouts
4
8
 
5
9
  # List layouts
10
+ #
11
+ # @see http://www.voog.com/developers/api/resources/layouts#get_layouts
6
12
  def layouts(params = {})
7
13
  paginate 'layouts', {query: params}
8
14
  end
9
15
 
10
16
  # Get a single layout
17
+ #
18
+ # @see http://www.voog.com/developers/api/resources/layouts#get_layout
11
19
  def layout(id, params = {})
12
20
  get "layouts/#{id}", {query: params}
13
21
  end
14
22
 
15
23
  # Create a layout
24
+ #
25
+ # @see http://www.voog.com/developers/api/resources/layouts#create_layout
16
26
  def create_layout(data)
17
27
  post 'layouts', data
18
28
  end
19
29
 
20
30
  # Update a layout
31
+ #
32
+ # @see http://www.voog.com/developers/api/resources/layouts#update_layout
21
33
  def update_layout(id, data)
22
34
  put "layouts/#{id}", data
23
35
  end
24
36
 
25
37
  # Delete a layout
38
+ #
39
+ # @see http://www.voog.com/developers/api/resources/layouts#remove_layout
26
40
  def delete_layout(id)
27
41
  delete "layouts/#{id}"
28
42
  end