contentful 0.1.0 → 0.1.1
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 +7 -0
- data/.gitignore +1 -0
- data/ChangeLog.md +6 -0
- data/Gemfile +5 -0
- data/README.md +1 -0
- data/contentful.gemspec +1 -1
- data/lib/contentful/array.rb +1 -2
- data/lib/contentful/asset.rb +3 -3
- data/lib/contentful/client.rb +15 -18
- data/lib/contentful/content_type.rb +1 -1
- data/lib/contentful/dynamic_entry.rb +6 -6
- data/lib/contentful/entry.rb +1 -1
- data/lib/contentful/error.rb +3 -3
- data/lib/contentful/field.rb +1 -1
- data/lib/contentful/file.rb +1 -1
- data/lib/contentful/link.rb +2 -2
- data/lib/contentful/locale.rb +1 -1
- data/lib/contentful/location.rb +1 -1
- data/lib/contentful/resource.rb +10 -11
- data/lib/contentful/resource_builder.rb +63 -39
- data/lib/contentful/space.rb +1 -1
- data/lib/contentful/support.rb +5 -3
- data/lib/contentful/version.rb +1 -1
- data/spec/fixtures/json_responses/includes.json +111 -0
- data/spec/fixtures/json_responses/link_array.json +43 -0
- data/spec/resource_building_spec.rb +20 -0
- data/spec/spec_helper.rb +5 -1
- metadata +138 -192
- data/.README.md.swp +0 -0
- data/do_request.sh +0 -5
- data/doc/Contentful.html +0 -131
- data/doc/Contentful/AccessDenied.html +0 -158
- data/doc/Contentful/Array.html +0 -346
- data/doc/Contentful/Asset.html +0 -315
- data/doc/Contentful/BadRequest.html +0 -158
- data/doc/Contentful/Client.html +0 -1407
- data/doc/Contentful/ContentType.html +0 -183
- data/doc/Contentful/DynamicEntry.html +0 -333
- data/doc/Contentful/Entry.html +0 -198
- data/doc/Contentful/Error.html +0 -413
- data/doc/Contentful/Field.html +0 -161
- data/doc/Contentful/File.html +0 -160
- data/doc/Contentful/Link.html +0 -275
- data/doc/Contentful/Locale.html +0 -161
- data/doc/Contentful/NotFound.html +0 -158
- data/doc/Contentful/Request.html +0 -669
- data/doc/Contentful/Resource.html +0 -606
- data/doc/Contentful/Resource/AssetFields.html +0 -413
- data/doc/Contentful/Resource/AssetFields/ClassMethods.html +0 -174
- data/doc/Contentful/Resource/ClassMethods.html +0 -271
- data/doc/Contentful/Resource/Fields.html +0 -398
- data/doc/Contentful/Resource/Fields/ClassMethods.html +0 -187
- data/doc/Contentful/Resource/SystemProperties.html +0 -444
- data/doc/Contentful/Resource/SystemProperties/ClassMethods.html +0 -174
- data/doc/Contentful/ResourceBuilder.html +0 -1400
- data/doc/Contentful/Response.html +0 -546
- data/doc/Contentful/ServerError.html +0 -158
- data/doc/Contentful/Space.html +0 -183
- data/doc/Contentful/Support.html +0 -198
- data/doc/Contentful/Unauthorized.html +0 -158
- data/doc/Contentful/UnparsableJson.html +0 -158
- data/doc/Contentful/UnparsableResource.html +0 -158
- data/doc/_index.html +0 -410
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -338
- data/doc/file.README.html +0 -214
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -214
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -533
- data/doc/top-level-namespace.html +0 -112
data/doc/css/common.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
/* Override this file with custom rules */
|
data/doc/css/full_list.css
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
margin: 0;
|
3
|
-
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
|
-
font-size: 13px;
|
5
|
-
height: 101%;
|
6
|
-
overflow-x: hidden;
|
7
|
-
}
|
8
|
-
|
9
|
-
h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
|
10
|
-
.clear { clear: both; }
|
11
|
-
#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; }
|
12
|
-
#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; }
|
13
|
-
#full_list { padding: 0; list-style: none; margin-left: 0; }
|
14
|
-
#full_list ul { padding: 0; }
|
15
|
-
#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
|
16
|
-
#noresults { padding: 7px 12px; }
|
17
|
-
#content.insearch #noresults { margin-left: 7px; }
|
18
|
-
ul.collapsed ul, ul.collapsed li { display: none; }
|
19
|
-
ul.collapsed.search_uncollapsed { display: block; }
|
20
|
-
ul.collapsed.search_uncollapsed li { display: list-item; }
|
21
|
-
li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
|
22
|
-
li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
|
23
|
-
li { color: #888; cursor: pointer; }
|
24
|
-
li.deprecated { text-decoration: line-through; font-style: italic; }
|
25
|
-
li.r1 { background: #f0f0f0; }
|
26
|
-
li.r2 { background: #fafafa; }
|
27
|
-
li:hover { background: #ddd; }
|
28
|
-
li small:before { content: "("; }
|
29
|
-
li small:after { content: ")"; }
|
30
|
-
li small.search_info { display: none; }
|
31
|
-
a:link, a:visited { text-decoration: none; color: #05a; }
|
32
|
-
li.clicked { background: #05a; color: #ccc; }
|
33
|
-
li.clicked a:link, li.clicked a:visited { color: #eee; }
|
34
|
-
li.clicked a.toggle { opacity: 0.5; background-position: bottom right; }
|
35
|
-
li.collapsed.clicked a.toggle { background-position: top right; }
|
36
|
-
#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
|
37
|
-
#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
|
38
|
-
#nav a:link, #nav a:visited { color: #358; }
|
39
|
-
#nav a:hover { background: transparent; color: #5af; }
|
40
|
-
.frames #nav span:after { content: ' | '; }
|
41
|
-
.frames #nav span:last-child:after { content: ''; }
|
42
|
-
|
43
|
-
.frames #content h1 { margin-top: 0; }
|
44
|
-
.frames li { white-space: nowrap; cursor: normal; }
|
45
|
-
.frames li small { display: block; font-size: 0.8em; }
|
46
|
-
.frames li small:before { content: ""; }
|
47
|
-
.frames li small:after { content: ""; }
|
48
|
-
.frames li small.search_info { display: none; }
|
49
|
-
.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
|
50
|
-
.frames #content.insearch #search { background-position: center right; }
|
51
|
-
.frames #search input { width: 110px; }
|
52
|
-
.frames #nav { display: block; }
|
53
|
-
|
54
|
-
#full_list.insearch li { display: none; }
|
55
|
-
#full_list.insearch li.found { display: list-item; padding-left: 10px; }
|
56
|
-
#full_list.insearch li a.toggle { display: none; }
|
57
|
-
#full_list.insearch li small.search_info { display: block; }
|
data/doc/css/style.css
DELETED
@@ -1,338 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
padding: 0 20px;
|
3
|
-
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
|
-
font-size: 13px;
|
5
|
-
}
|
6
|
-
body.frames { padding: 0 5px; }
|
7
|
-
h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
|
8
|
-
h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
|
9
|
-
h1.title { margin-bottom: 10px; }
|
10
|
-
h1.alphaindex { margin-top: 0; font-size: 22px; }
|
11
|
-
h2 {
|
12
|
-
padding: 0;
|
13
|
-
padding-bottom: 3px;
|
14
|
-
border-bottom: 1px #aaa solid;
|
15
|
-
font-size: 1.4em;
|
16
|
-
margin: 1.8em 0 0.5em;
|
17
|
-
}
|
18
|
-
h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; }
|
19
|
-
.clear { clear: both; }
|
20
|
-
.inline { display: inline; }
|
21
|
-
.inline p:first-child { display: inline; }
|
22
|
-
.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
|
23
|
-
.docstring h1 { font-size: 1.2em; }
|
24
|
-
.docstring h2 { font-size: 1.1em; }
|
25
|
-
.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
|
26
|
-
.summary_desc .object_link, .docstring .object_link { font-family: monospace; }
|
27
|
-
.rdoc-term { padding-right: 25px; font-weight: bold; }
|
28
|
-
.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
|
29
|
-
|
30
|
-
/* style for <table> */
|
31
|
-
#filecontents table, .docstring table { border-collapse: collapse; }
|
32
|
-
#filecontents table th, #filecontents table td,
|
33
|
-
.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; }
|
34
|
-
#filecontents table tr:nth-child(odd),
|
35
|
-
.docstring table tr:nth-child(odd) { background: #eee; }
|
36
|
-
#filecontents table tr:nth-child(even),
|
37
|
-
.docstring table tr:nth-child(even) { background: #fff; }
|
38
|
-
#filecontents table th, .docstring table th { background: #fff; }
|
39
|
-
|
40
|
-
/* style for <ul> */
|
41
|
-
#filecontents li > p, .docstring li > p { margin: 0px; }
|
42
|
-
#filecontents ul, .docstring ul { padding-left: 20px; }
|
43
|
-
/* style for <dl> */
|
44
|
-
#filecontents dl, .docstring dl { border: 1px solid #ccc; }
|
45
|
-
#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; }
|
46
|
-
#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; }
|
47
|
-
#filecontents dd > p, .docstring dd > p { margin: 0px; }
|
48
|
-
|
49
|
-
.note {
|
50
|
-
color: #222;
|
51
|
-
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
52
|
-
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
53
|
-
display: block;
|
54
|
-
}
|
55
|
-
.note.todo { background: #ffffc5; border-color: #ececaa; }
|
56
|
-
.note.returns_void { background: #efefef; }
|
57
|
-
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
58
|
-
.note.private { background: #ffffc5; border-color: #ececaa; }
|
59
|
-
.note.title { padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
|
60
|
-
.summary_signature + .note.title { margin-left: 7px; }
|
61
|
-
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
62
|
-
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
63
|
-
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
64
|
-
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
65
|
-
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
66
|
-
.note.title.not_defined_here { background: transparent; border: none; font-style: italic; }
|
67
|
-
.discussion .note { margin-top: 6px; }
|
68
|
-
.discussion .note:first-child { margin-top: 0; }
|
69
|
-
|
70
|
-
h3.inherited {
|
71
|
-
font-style: italic;
|
72
|
-
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
73
|
-
font-weight: normal;
|
74
|
-
padding: 0;
|
75
|
-
margin: 0;
|
76
|
-
margin-top: 12px;
|
77
|
-
margin-bottom: 3px;
|
78
|
-
font-size: 13px;
|
79
|
-
}
|
80
|
-
p.inherited {
|
81
|
-
padding: 0;
|
82
|
-
margin: 0;
|
83
|
-
margin-left: 25px;
|
84
|
-
}
|
85
|
-
|
86
|
-
#filecontents dl.box, dl.box {
|
87
|
-
border: 0;
|
88
|
-
width: 520px;
|
89
|
-
font-size: 1em;
|
90
|
-
}
|
91
|
-
#filecontents dl.box dt, dl.box dt {
|
92
|
-
float: left;
|
93
|
-
display: block;
|
94
|
-
width: 100px;
|
95
|
-
margin: 0;
|
96
|
-
text-align: right;
|
97
|
-
font-weight: bold;
|
98
|
-
background: transparent;
|
99
|
-
border: 1px solid #aaa;
|
100
|
-
border-width: 1px 0px 0px 1px;
|
101
|
-
padding: 6px 0;
|
102
|
-
padding-right: 10px;
|
103
|
-
}
|
104
|
-
#filecontents dl.box dd, dl.box dd {
|
105
|
-
float: left;
|
106
|
-
display: block;
|
107
|
-
width: 380px;
|
108
|
-
margin: 0;
|
109
|
-
padding: 6px 0;
|
110
|
-
padding-right: 20px;
|
111
|
-
border: 1px solid #aaa;
|
112
|
-
border-width: 1px 1px 0 0;
|
113
|
-
}
|
114
|
-
#filecontents dl.box .last, dl.box .last {
|
115
|
-
border-bottom: 1px solid #aaa;
|
116
|
-
}
|
117
|
-
#filecontents dl.box .r1, dl.box .r1 { background: #eee; }
|
118
|
-
|
119
|
-
ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
120
|
-
.index_inline_list { padding-left: 0; font-size: 1.1em; }
|
121
|
-
.index_inline_list li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
122
|
-
|
123
|
-
dl.constants { margin-left: 40px; }
|
124
|
-
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
125
|
-
dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
|
126
|
-
|
127
|
-
.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
|
128
|
-
.summary_desc tt { font-size: 0.9em; }
|
129
|
-
dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; }
|
130
|
-
dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
|
131
|
-
dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; }
|
132
|
-
dl.constants .discussion *:first-child { margin-top: 0; }
|
133
|
-
dl.constants .discussion *:last-child { margin-bottom: 0; }
|
134
|
-
|
135
|
-
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
136
|
-
.method_details.first { border: 0; }
|
137
|
-
p.signature, h3.signature {
|
138
|
-
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
139
|
-
padding: 6px 10px; margin-top: 18px;
|
140
|
-
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
141
|
-
}
|
142
|
-
p.signature tt,
|
143
|
-
h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
|
144
|
-
p.signature .overload,
|
145
|
-
h3.signature .overload { display: block; }
|
146
|
-
p.signature .extras,
|
147
|
-
h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
|
148
|
-
p.signature .not_defined_here,
|
149
|
-
h3.signature .not_defined_here,
|
150
|
-
p.signature .aliases,
|
151
|
-
h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
|
152
|
-
p.signature .aliases .names,
|
153
|
-
h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
|
154
|
-
|
155
|
-
.tags .tag_title { font-size: 1em; margin-bottom: 0; font-weight: bold; }
|
156
|
-
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
157
|
-
.tags ul li { margin-bottom: 3px; }
|
158
|
-
.tags ul .name { font-family: monospace; font-weight: bold; }
|
159
|
-
.tags ul .note { padding: 3px 6px; }
|
160
|
-
.tags { margin-bottom: 12px; }
|
161
|
-
|
162
|
-
.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; }
|
163
|
-
.tags .examples .inline p { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
|
164
|
-
|
165
|
-
.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
|
166
|
-
.tags .overload .overload_item .signature {
|
167
|
-
padding: 2px 8px;
|
168
|
-
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
169
|
-
}
|
170
|
-
.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; }
|
171
|
-
.tags .overload .docstring { margin-top: 15px; }
|
172
|
-
|
173
|
-
.defines { display: none; }
|
174
|
-
|
175
|
-
#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; }
|
176
|
-
|
177
|
-
.showSource { font-size: 0.9em; }
|
178
|
-
.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; }
|
179
|
-
|
180
|
-
#content a:link, #content a:visited { text-decoration: none; color: #05a; }
|
181
|
-
#content a:hover { background: #ffffa5; }
|
182
|
-
div.docstring, p.docstring { margin-right: 6em; }
|
183
|
-
|
184
|
-
ul.summary {
|
185
|
-
list-style: none;
|
186
|
-
font-family: monospace;
|
187
|
-
font-size: 1em;
|
188
|
-
line-height: 1.5em;
|
189
|
-
}
|
190
|
-
ul.summary a:link, ul.summary a:visited {
|
191
|
-
text-decoration: none; font-size: 1.1em;
|
192
|
-
}
|
193
|
-
ul.summary li { margin-bottom: 5px; }
|
194
|
-
.summary .summary_signature {
|
195
|
-
padding: 1px 10px;
|
196
|
-
background: #eaeaff; border: 1px solid #dfdfe5;
|
197
|
-
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
198
|
-
}
|
199
|
-
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
200
|
-
ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
|
201
|
-
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
202
|
-
#content .summary_signature:hover a:link,
|
203
|
-
#content .summary_signature:hover a:visited {
|
204
|
-
background: transparent;
|
205
|
-
color: #48f;
|
206
|
-
}
|
207
|
-
|
208
|
-
p.inherited a { font-family: monospace; font-size: 0.9em; }
|
209
|
-
p.inherited { word-spacing: 5px; font-size: 1.2em; }
|
210
|
-
|
211
|
-
p.children { font-size: 1.2em; }
|
212
|
-
p.children a { font-size: 0.9em; }
|
213
|
-
p.children strong { font-size: 0.8em; }
|
214
|
-
p.children strong.modules { padding-left: 5px; }
|
215
|
-
|
216
|
-
ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
|
217
|
-
ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
|
218
|
-
ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqA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TQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; }
|
219
|
-
ul.fullTree li:first-child { padding-top: 0; background: transparent; }
|
220
|
-
ul.fullTree li:last-child { padding-bottom: 0; }
|
221
|
-
.showAll ul.fullTree { display: block; }
|
222
|
-
.showAll .inheritName { display: none; }
|
223
|
-
|
224
|
-
#search { position: absolute; right: 14px; top: 0px; }
|
225
|
-
#search a:link, #search a:visited {
|
226
|
-
display: block; float: left; margin-right: 4px;
|
227
|
-
padding: 8px 10px; text-decoration: none; color: #05a;
|
228
|
-
border: 1px solid #d8d8e5;
|
229
|
-
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
230
|
-
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
231
|
-
background: #eaf0ff;
|
232
|
-
-webkit-box-shadow: -1px 1px 3px #ddd;
|
233
|
-
}
|
234
|
-
#search a:hover { background: #f5faff; color: #06b; }
|
235
|
-
#search a.active {
|
236
|
-
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
237
|
-
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
238
|
-
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
239
|
-
}
|
240
|
-
#search a.inactive { color: #999; }
|
241
|
-
.frames #search { display: none; }
|
242
|
-
.inheritanceTree, .toggleDefines { float: right; }
|
243
|
-
|
244
|
-
#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
|
245
|
-
#menu .title, #menu a { font-size: 0.7em; }
|
246
|
-
#menu .title a { font-size: 1em; }
|
247
|
-
#menu .title { color: #555; }
|
248
|
-
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
249
|
-
#menu a:hover { color: #05a; }
|
250
|
-
#menu .noframes { display: inline; }
|
251
|
-
.frames #menu .noframes { display: inline; float: right; }
|
252
|
-
|
253
|
-
#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
|
254
|
-
#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
255
|
-
#footer a:hover { color: #05a; }
|
256
|
-
|
257
|
-
#listing ul.alpha { font-size: 1.1em; }
|
258
|
-
#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
|
259
|
-
#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
|
260
|
-
#listing ul.alpha ul { margin: 0; padding-left: 15px; }
|
261
|
-
#listing ul small { color: #666; font-size: 0.7em; }
|
262
|
-
|
263
|
-
li.r1 { background: #f0f0f0; }
|
264
|
-
li.r2 { background: #fafafa; }
|
265
|
-
|
266
|
-
#search_frame {
|
267
|
-
z-index: 9999;
|
268
|
-
background: #fff;
|
269
|
-
display: none;
|
270
|
-
position: absolute;
|
271
|
-
top: 36px;
|
272
|
-
right: 18px;
|
273
|
-
width: 500px;
|
274
|
-
height: 80%;
|
275
|
-
overflow-y: scroll;
|
276
|
-
border: 1px solid #999;
|
277
|
-
border-collapse: collapse;
|
278
|
-
-webkit-box-shadow: -7px 5px 25px #aaa;
|
279
|
-
-moz-box-shadow: -7px 5px 25px #aaa;
|
280
|
-
-moz-border-radius: 2px;
|
281
|
-
-webkit-border-radius: 2px;
|
282
|
-
}
|
283
|
-
|
284
|
-
#content ul.summary li.deprecated .summary_signature a:link,
|
285
|
-
#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; }
|
286
|
-
|
287
|
-
#toc {
|
288
|
-
padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
|
289
|
-
max-width: 300px;
|
290
|
-
-webkit-box-shadow: -2px 2px 6px #bbb;
|
291
|
-
-moz-box-shadow: -2px 2px 6px #bbb;
|
292
|
-
z-index: 5000;
|
293
|
-
position: relative;
|
294
|
-
}
|
295
|
-
#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
296
|
-
#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
|
297
|
-
#toc .title { margin: 0; }
|
298
|
-
#toc ol { padding-left: 1.8em; }
|
299
|
-
#toc li { font-size: 1.1em; line-height: 1.7em; }
|
300
|
-
#toc > ol > li { font-size: 1.1em; font-weight: bold; }
|
301
|
-
#toc ol > ol { font-size: 0.9em; }
|
302
|
-
#toc ol ol > ol { padding-left: 2.3em; }
|
303
|
-
#toc ol + li { margin-top: 0.3em; }
|
304
|
-
#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
305
|
-
#filecontents h1 + #toc.nofloat { margin-top: 0; }
|
306
|
-
|
307
|
-
/* syntax highlighting */
|
308
|
-
.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
|
309
|
-
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
310
|
-
#filecontents pre.code, .docstring pre.code { display: block; }
|
311
|
-
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
312
|
-
#filecontents pre.code, .docstring pre.code,
|
313
|
-
.tags pre.example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
314
|
-
pre.code { color: #000; }
|
315
|
-
pre.code .info.file { color: #555; }
|
316
|
-
pre.code .val { color: #036A07; }
|
317
|
-
pre.code .tstring_content,
|
318
|
-
pre.code .heredoc_beg, pre.code .heredoc_end,
|
319
|
-
pre.code .qwords_beg, pre.code .qwords_end,
|
320
|
-
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
321
|
-
pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
|
322
|
-
pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
|
323
|
-
pre.code .dot + pre.code .id,
|
324
|
-
pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
|
325
|
-
pre.code .comment { color: #0066FF; }
|
326
|
-
pre.code .const, pre.code .constant { color: #585CF6; }
|
327
|
-
pre.code .label,
|
328
|
-
pre.code .symbol { color: #C5060B; }
|
329
|
-
pre.code .kw,
|
330
|
-
pre.code .rubyid_require,
|
331
|
-
pre.code .rubyid_extend,
|
332
|
-
pre.code .rubyid_include { color: #0000FF; }
|
333
|
-
pre.code .ivar { color: #318495; }
|
334
|
-
pre.code .gvar,
|
335
|
-
pre.code .rubyid_backref,
|
336
|
-
pre.code .rubyid_nth_ref { color: #6D79DE; }
|
337
|
-
pre.code .regexp, .dregexp { color: #036A07; }
|
338
|
-
pre.code a { border-bottom: 1px dotted #bbf; }
|
data/doc/file.README.html
DELETED
@@ -1,214 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
|
6
|
-
<title>
|
7
|
-
File: README
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.3
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '';
|
20
|
-
framesUrl = "frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="_index.html">Index</a> »
|
35
|
-
<span class="title">File: README</span>
|
36
|
-
|
37
|
-
|
38
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="search">
|
42
|
-
|
43
|
-
<a class="full_list_link" id="class_list_link"
|
44
|
-
href="class_list.html">
|
45
|
-
Class List
|
46
|
-
</a>
|
47
|
-
|
48
|
-
<a class="full_list_link" id="method_list_link"
|
49
|
-
href="method_list.html">
|
50
|
-
Method List
|
51
|
-
</a>
|
52
|
-
|
53
|
-
<a class="full_list_link" id="file_list_link"
|
54
|
-
href="file_list.html">
|
55
|
-
File List
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<iframe id="search_frame"></iframe>
|
63
|
-
|
64
|
-
<div id="content"><div id='filecontents'><h1>contentful.rb</h1>
|
65
|
-
|
66
|
-
<p>Ruby client for the <a href="https://www.contentful.com">Contentful</a> Content Delivery API.</p>
|
67
|
-
|
68
|
-
<p><a href="https://www.contentful.com">Contentful</a> is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.</p>
|
69
|
-
|
70
|
-
<h2>Setup</h2>
|
71
|
-
|
72
|
-
<p>Add to your Gemfile and bundle:</p>
|
73
|
-
|
74
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>contentful</span><span class='tstring_end'>'</span></span>
|
75
|
-
</code></pre>
|
76
|
-
|
77
|
-
<h2>Usage</h2>
|
78
|
-
|
79
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>Contentful</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
80
|
-
<span class='label'>access_token:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>b4c0n73n7fu1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
81
|
-
<span class='label'>space:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cfexampleapi</span><span class='tstring_end'>'</span></span>
|
82
|
-
<span class='rparen'>)</span>
|
83
|
-
</code></pre>
|
84
|
-
|
85
|
-
<p>You can query for entries, assets, etc. very similar as described in the
|
86
|
-
<a href="https://www.contentful.com/developers/documentation/content-delivery-api/">Delivery API Documentation</a>. Please note, that all methods of the Ruby client library are snake_cased, instead of JavaScript's camelCase:</p>
|
87
|
-
|
88
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_content_types'>content_types</span>
|
89
|
-
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entry'>entry</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nyancat</span><span class='tstring_end'>'</span></span>
|
90
|
-
</code></pre>
|
91
|
-
|
92
|
-
<p>You can pass the usual filter options to the query:</p>
|
93
|
-
|
94
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>sys.id[ne]</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nyancat</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'># query for all entries except 'nyancat'
|
95
|
-
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='label'>include:</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='comment'># include one level of linked resources
|
96
|
-
</span></code></pre>
|
97
|
-
|
98
|
-
<p>The results are returned as Contentful::Resource objects. Multiple results will be returned as Contentful::Array. By combining skip and limit you can achieve pagination:</p>
|
99
|
-
|
100
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='label'>skip:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>15</span><span class='rparen'>)</span> <span class='comment'># page 1
|
101
|
-
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='label'>skip:</span> <span class='int'>15</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>30</span><span class='rparen'>)</span> <span class='comment'># page 2
|
102
|
-
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='label'>skip:</span> <span class='int'>30</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>45</span><span class='rparen'>)</span> <span class='comment'># page 3 etc.
|
103
|
-
</span></code></pre>
|
104
|
-
|
105
|
-
<p>The properties of a resource can be accessed through Ruby methods. Alternatively the data can be accessed as Ruby Hash.</p>
|
106
|
-
|
107
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_content_type'>content_type</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_content_type'>content_type</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cat</span><span class='tstring_end'>'</span></span>
|
108
|
-
<span class='id identifier rubyid_content_type'>content_type</span><span class='period'>.</span><span class='id identifier rubyid_description'>description</span> <span class='comment'># "Meow."
|
109
|
-
</span><span class='id identifier rubyid_content_type'>content_type</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span> <span class='comment'># { name: '...', description: '...' }
|
110
|
-
</span></code></pre>
|
111
|
-
|
112
|
-
<p>System Properties behave in the same way and can be accessed with the <code>#sys</code> method.</p>
|
113
|
-
|
114
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_content_type'>content_type</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># => 'cat'
|
115
|
-
</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='comment'># => 'Entry'
|
116
|
-
</span><span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_sys'>sys</span> <span class='comment'># { id: '...', type: '...' }
|
117
|
-
</span></code></pre>
|
118
|
-
|
119
|
-
<p>Entry Fields usually don't have direct method accessors, since they are based on individual content types. These fields can be accessed through the <code>#fields</code> method.</p>
|
120
|
-
|
121
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entry'>entry</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nyancat</span><span class='tstring_end'>'</span></span>
|
122
|
-
<span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:color</span><span class='rbracket'>]</span> <span class='comment'># rainbow
|
123
|
-
</span></code></pre>
|
124
|
-
|
125
|
-
<h3>Dynamic Entries</h3>
|
126
|
-
|
127
|
-
<p>However, you can set <code>:dynamic_entries</code> to <code>:auto</code> in your client configuration (see below). If using this option, the client will fetch all available content types and use them to create dynamic entries on the fly.</p>
|
128
|
-
|
129
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>Contentful</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
130
|
-
<span class='label'>access_token:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>b4c0n73n7fu1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
131
|
-
<span class='label'>space:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cfexampleapi</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
132
|
-
<span class='label'>dynamic_entries:</span> <span class='symbol'>:auto</span><span class='comma'>,</span>
|
133
|
-
<span class='rparen'>)</span>
|
134
|
-
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entry'>entry</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nyancat</span><span class='tstring_end'>'</span></span> <span class='comment'># => #<Contentful::DynamicEntry[cat]: ...>
|
135
|
-
</span></code></pre>
|
136
|
-
|
137
|
-
<p>The previous example fetches all content_types on initialization. If you want to do it by hand, you will need to set the option to <code>:manual</code> and call <code>client.update_dynamic_entry_cache!</code> to fetch all content types.</p>
|
138
|
-
|
139
|
-
<h3>Links</h3>
|
140
|
-
|
141
|
-
<p>You can easily request a resource that is represented by a link, by calling <code>#resolve</code>:</p>
|
142
|
-
|
143
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_happycat'>happycat</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_entry'>entry</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>happycat</span><span class='tstring_end'>'</span></span>
|
144
|
-
<span class='id identifier rubyid_happycat'>happycat</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:image</span><span class='rbracket'>]</span>
|
145
|
-
<span class='comment'># => #<Contentful::Link: @sys={:type=>"Link", :linkType=>"Asset", :id=>"happycat"}>
|
146
|
-
</span><span class='id identifier rubyid_happycat'>happycat</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:image</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_resolve'>resolve</span> <span class='comment'># => #<Contentful::Asset: @fields={ ...
|
147
|
-
</span></code></pre>
|
148
|
-
|
149
|
-
<h3>Assets</h3>
|
150
|
-
|
151
|
-
<p>There is a helpful method for adding the image resize options for an asset image:</p>
|
152
|
-
|
153
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>happycat</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_image_url'>image_url</span>
|
154
|
-
<span class='comment'># => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg"
|
155
|
-
</span>
|
156
|
-
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>happycat</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_image_url'>image_url</span> <span class='label'>width:</span> <span class='int'>300</span><span class='comma'>,</span> <span class='label'>height:</span> <span class='int'>200</span><span class='comma'>,</span> <span class='label'>format:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jpg</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>quality:</span> <span class='int'>100</span>
|
157
|
-
<span class='comment'># => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg?w=300&h=200&fm=jpg&q=100"
|
158
|
-
</span></code></pre>
|
159
|
-
|
160
|
-
<h2>Configuration Options</h2>
|
161
|
-
|
162
|
-
<h3>:space</h3>
|
163
|
-
|
164
|
-
<p>Required option. The name of the space you want to access.</p>
|
165
|
-
|
166
|
-
<h3>:access_token</h3>
|
167
|
-
|
168
|
-
<p>Required option. The space's secret token.</p>
|
169
|
-
|
170
|
-
<h3>:secure</h3>
|
171
|
-
|
172
|
-
<p>Whether to use https. Defaults to <code>true</code>.</p>
|
173
|
-
|
174
|
-
<h3>:authentication_mechanism</h3>
|
175
|
-
|
176
|
-
<p>How to authenticate with the API. Supports <code>:header</code> (default) or <code>:query_string</code>.</p>
|
177
|
-
|
178
|
-
<h3>:raise_errors</h3>
|
179
|
-
|
180
|
-
<p>If set to <code>true</code> (default), error responses will be raised. If set to <code>false</code>, the error objects will simply be returned.</p>
|
181
|
-
|
182
|
-
<h3>:dynamic_entries</h3>
|
183
|
-
|
184
|
-
<p><code>false</code>, <code>:auto</code> or <code>:manual</code>. See resource description above for details on usage.</p>
|
185
|
-
|
186
|
-
<h3>:raw_mode</h3>
|
187
|
-
|
188
|
-
<p>Defaults to <code>false</code>. If enabled, the API responses will not be parsed to resource objects. Might be useful for debugging.</p>
|
189
|
-
|
190
|
-
<h2>Advanced</h2>
|
191
|
-
|
192
|
-
<h3>Dynamic Entries</h3>
|
193
|
-
|
194
|
-
<p>In <code>:dynamic_entries</code> mode (see above), all entries are returned as specialized entry classes. However, you can also create these specialized classes by yourself, based on a content_type:</p>
|
195
|
-
|
196
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_content_type'>content_type</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_content_type'>content_type</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nyancat</span><span class='tstring_end'>'</span></span>
|
197
|
-
<span class='const'>MyEntry</span> <span class='op'>=</span> <span class='const'>Contentful</span><span class='op'>::</span><span class='const'>DynamicEntry</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_content_type'>content_type</span><span class='rparen'>)</span>
|
198
|
-
</code></pre>
|
199
|
-
|
200
|
-
<p>It is also possible to pass in the raw content_type JSON string, as returned from the api. See the RDOC for more details.</p>
|
201
|
-
|
202
|
-
<h2>License</h2>
|
203
|
-
|
204
|
-
<p>Copyright (c) 2014 Contentful GmbH - Jan Lelis. See LICENSE.txt for further details.</p>
|
205
|
-
</div></div>
|
206
|
-
|
207
|
-
<div id="footer">
|
208
|
-
Generated on Tue Mar 11 09:25:52 2014 by
|
209
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
210
|
-
0.8.7.3 (ruby-1.9.3).
|
211
|
-
</div>
|
212
|
-
|
213
|
-
</body>
|
214
|
-
</html>
|