built.io 0.4 → 0.7
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.
- data/lib/built.rb +1 -0
- data/lib/built/application.rb +9 -2
- data/lib/built/class.rb +10 -3
- data/lib/built/object.rb +20 -7
- metadata +52 -29
- data/doc/Built.html +0 -518
- data/doc/Built/Application.html +0 -449
- data/doc/Built/BuiltAPIError.html +0 -460
- data/doc/Built/BuiltError.html +0 -138
- data/doc/Built/Class.html +0 -685
- data/doc/Built/Client.html +0 -397
- data/doc/Built/Object.html +0 -1128
- data/doc/Built/Query.html +0 -2788
- data/doc/Built/QueryResponse.html +0 -386
- data/doc/Built/Timestamps.html +0 -282
- data/doc/Built/Util.html +0 -211
- data/doc/_index.html +0 -228
- 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 -131
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -131
- data/doc/js/app.js +0 -214
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -419
- data/doc/top-level-namespace.html +0 -151
data/lib/built.rb
CHANGED
data/lib/built/application.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Built
|
2
|
-
class Application <
|
2
|
+
class Application < DirtyHashy
|
3
3
|
include Built::Timestamps
|
4
4
|
|
5
5
|
# Get the uid of this application
|
@@ -24,10 +24,17 @@ module Built
|
|
24
24
|
end
|
25
25
|
|
26
26
|
class << self
|
27
|
+
def instantiate(data)
|
28
|
+
doc = new
|
29
|
+
doc.replace(data)
|
30
|
+
doc.clean_up!
|
31
|
+
doc
|
32
|
+
end
|
33
|
+
|
27
34
|
# Get the application you are working with
|
28
35
|
# @return [Application]
|
29
36
|
def get
|
30
|
-
|
37
|
+
instantiate(
|
31
38
|
Built.client.request(uri)
|
32
39
|
.parsed_response["application"]
|
33
40
|
)
|
data/lib/built/class.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Built
|
2
2
|
# Built::Class provides the schema and provides grouping for
|
3
3
|
# different classes of objects.
|
4
|
-
class Class <
|
4
|
+
class Class < DirtyHashy
|
5
5
|
include Built::Timestamps
|
6
6
|
|
7
7
|
# Get the uid for this class
|
@@ -27,12 +27,19 @@ module Built
|
|
27
27
|
end
|
28
28
|
|
29
29
|
class << self
|
30
|
+
def instantiate(data)
|
31
|
+
doc = new
|
32
|
+
doc.replace(data)
|
33
|
+
doc.clean_up!
|
34
|
+
doc
|
35
|
+
end
|
36
|
+
|
30
37
|
# Get all classes from built. Returns an array of classes.
|
31
38
|
# @raise Built::BuiltAPIError
|
32
39
|
# @return [Array] classes An array of classes
|
33
40
|
def get_all
|
34
41
|
Built.client.request(uri)
|
35
|
-
.parsed_response["classes"].map {|o|
|
42
|
+
.parsed_response["classes"].map {|o| instantiate(o)}
|
36
43
|
end
|
37
44
|
|
38
45
|
# Get a single class by its uid
|
@@ -40,7 +47,7 @@ module Built
|
|
40
47
|
# @param [String] uid The uid of the class
|
41
48
|
# @return [Class] class An instance of Built::Class
|
42
49
|
def get(uid)
|
43
|
-
|
50
|
+
instantiate(
|
44
51
|
Built.client.request(uri(uid))
|
45
52
|
.parsed_response["class"]
|
46
53
|
)
|
data/lib/built/object.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Built
|
2
2
|
# Built::Object is the unit of data in built.io
|
3
|
-
class Object <
|
3
|
+
class Object < DirtyHashy
|
4
4
|
include Built::Timestamps
|
5
5
|
|
6
6
|
# Get the uid for this object
|
@@ -17,13 +17,13 @@ module Built
|
|
17
17
|
# Fetch the latest instance of this object from built
|
18
18
|
# @raise BuiltError If the uid is not set
|
19
19
|
# @return [Object] self
|
20
|
-
def
|
20
|
+
def sync
|
21
21
|
if !uid
|
22
22
|
# uid is not set
|
23
23
|
raise BuiltError, I18n.t("objects.uid_not_set")
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
instantiate(
|
27
27
|
Built.client.request(uri)
|
28
28
|
.parsed_response["object"]
|
29
29
|
)
|
@@ -40,7 +40,7 @@ module Built
|
|
40
40
|
def save(options={})
|
41
41
|
if is_new?
|
42
42
|
# create
|
43
|
-
|
43
|
+
instantiate(
|
44
44
|
Built.client.request(uri, :post, wrap)
|
45
45
|
.parsed_response["object"]
|
46
46
|
)
|
@@ -51,7 +51,7 @@ module Built
|
|
51
51
|
self["published"] = false if options[:draft]
|
52
52
|
|
53
53
|
# update
|
54
|
-
|
54
|
+
instantiate(
|
55
55
|
Built.client.request(uri, :put, wrap, nil, headers)
|
56
56
|
.parsed_response["object"]
|
57
57
|
)
|
@@ -98,12 +98,19 @@ module Built
|
|
98
98
|
@class_uid = class_uid
|
99
99
|
|
100
100
|
if data
|
101
|
-
|
101
|
+
instantiate(data)
|
102
102
|
end
|
103
103
|
|
104
104
|
self
|
105
105
|
end
|
106
106
|
|
107
|
+
# @api private
|
108
|
+
def instantiate(data)
|
109
|
+
replace(data)
|
110
|
+
clean_up!
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
107
114
|
private
|
108
115
|
|
109
116
|
def uri
|
@@ -115,7 +122,8 @@ module Built
|
|
115
122
|
end
|
116
123
|
|
117
124
|
def wrap
|
118
|
-
|
125
|
+
changed_keys = self.changes.keys
|
126
|
+
{"object" => self.select {|o| changed_keys.include?(o)}}
|
119
127
|
end
|
120
128
|
|
121
129
|
def to_s
|
@@ -123,6 +131,11 @@ module Built
|
|
123
131
|
end
|
124
132
|
|
125
133
|
class << self
|
134
|
+
def instantiate(data)
|
135
|
+
doc = new
|
136
|
+
doc.instantiate(data)
|
137
|
+
end
|
138
|
+
|
126
139
|
# @api private
|
127
140
|
def uri(class_uid)
|
128
141
|
class_uri = Built::Class.uri(class_uid)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: built.io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,13 +13,61 @@ date: 2014-03-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.6.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.6.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: httmultiparty
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - '='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.3.10
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.3.10
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: dirty_hashy
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.2.1
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.2.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
16
64
|
requirement: !ruby/object:Gem::Requirement
|
17
65
|
none: false
|
18
66
|
requirements:
|
19
67
|
- - ! '>='
|
20
68
|
- !ruby/object:Gem::Version
|
21
69
|
version: '0'
|
22
|
-
type: :
|
70
|
+
type: :development
|
23
71
|
prerelease: false
|
24
72
|
version_requirements: !ruby/object:Gem::Requirement
|
25
73
|
none: false
|
@@ -28,14 +76,14 @@ dependencies:
|
|
28
76
|
- !ruby/object:Gem::Version
|
29
77
|
version: '0'
|
30
78
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
79
|
+
name: webmock
|
32
80
|
requirement: !ruby/object:Gem::Requirement
|
33
81
|
none: false
|
34
82
|
requirements:
|
35
83
|
- - ! '>='
|
36
84
|
- !ruby/object:Gem::Version
|
37
85
|
version: '0'
|
38
|
-
type: :
|
86
|
+
type: :development
|
39
87
|
prerelease: false
|
40
88
|
version_requirements: !ruby/object:Gem::Requirement
|
41
89
|
none: false
|
@@ -62,31 +110,6 @@ files:
|
|
62
110
|
- lib/built/object.rb
|
63
111
|
- lib/locales/en.yml
|
64
112
|
- lib/built.rb
|
65
|
-
- doc/js/app.js
|
66
|
-
- doc/js/full_list.js
|
67
|
-
- doc/js/jquery.js
|
68
|
-
- doc/index.html
|
69
|
-
- doc/file.README.html
|
70
|
-
- doc/Built/Util.html
|
71
|
-
- doc/Built/Query.html
|
72
|
-
- doc/Built/Client.html
|
73
|
-
- doc/Built/BuiltAPIError.html
|
74
|
-
- doc/Built/Timestamps.html
|
75
|
-
- doc/Built/Object.html
|
76
|
-
- doc/Built/BuiltError.html
|
77
|
-
- doc/Built/Class.html
|
78
|
-
- doc/Built/Application.html
|
79
|
-
- doc/Built/QueryResponse.html
|
80
|
-
- doc/top-level-namespace.html
|
81
|
-
- doc/method_list.html
|
82
|
-
- doc/_index.html
|
83
|
-
- doc/Built.html
|
84
|
-
- doc/file_list.html
|
85
|
-
- doc/css/common.css
|
86
|
-
- doc/css/style.css
|
87
|
-
- doc/css/full_list.css
|
88
|
-
- doc/frames.html
|
89
|
-
- doc/class_list.html
|
90
113
|
- MIT-LICENSE
|
91
114
|
- README.md
|
92
115
|
homepage: https://github.com/raweng/built.io-ruby-sdk
|
data/doc/Built.html
DELETED
@@ -1,518 +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=utf-8" />
|
6
|
-
<title>
|
7
|
-
Module: Built
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.2
|
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 (B)</a> »
|
35
|
-
|
36
|
-
|
37
|
-
<span class="title">Built</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Module: Built
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<dt class="r1 last">Defined in:</dt>
|
82
|
-
<dd class="r1 last">lib/built.rb<span class="defines">,<br />
|
83
|
-
lib/built/util.rb,<br /> lib/built/class.rb,<br /> lib/built/query.rb,<br /> lib/built/error.rb,<br /> lib/built/client.rb,<br /> lib/built/object.rb,<br /> lib/built/timestamps.rb,<br /> lib/built/application.rb</span>
|
84
|
-
</dd>
|
85
|
-
|
86
|
-
</dl>
|
87
|
-
<div class="clear"></div>
|
88
|
-
|
89
|
-
<h2>Defined Under Namespace</h2>
|
90
|
-
<p class="children">
|
91
|
-
|
92
|
-
|
93
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Built/Timestamps.html" title="Built::Timestamps (module)">Timestamps</a></span>
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Built/Application.html" title="Built::Application (class)">Application</a></span>, <span class='object_link'><a href="Built/BuiltAPIError.html" title="Built::BuiltAPIError (class)">BuiltAPIError</a></span>, <span class='object_link'><a href="Built/BuiltError.html" title="Built::BuiltError (class)">BuiltError</a></span>, <span class='object_link'><a href="Built/Class.html" title="Built::Class (class)">Class</a></span>, <span class='object_link'><a href="Built/Client.html" title="Built::Client (class)">Client</a></span>, <span class='object_link'><a href="Built/Object.html" title="Built::Object (class)">Object</a></span>, <span class='object_link'><a href="Built/Query.html" title="Built::Query (class)">Query</a></span>, <span class='object_link'><a href="Built/QueryResponse.html" title="Built::QueryResponse (class)">QueryResponse</a></span>, <span class='object_link'><a href="Built/Util.html" title="Built::Util (class)">Util</a></span>
|
98
|
-
|
99
|
-
|
100
|
-
</p>
|
101
|
-
|
102
|
-
<h2>Constant Summary</h2>
|
103
|
-
|
104
|
-
<dl class="constants">
|
105
|
-
|
106
|
-
<dt id="client-classvariable" class="">@@client =
|
107
|
-
<div class="docstring">
|
108
|
-
<div class="discussion">
|
109
|
-
<p class="note private">
|
110
|
-
<strong>This classvariable is part of a private API.</strong>
|
111
|
-
You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
|
112
|
-
</p>
|
113
|
-
|
114
|
-
<p>singleton http client</p>
|
115
|
-
|
116
|
-
|
117
|
-
</div>
|
118
|
-
</div>
|
119
|
-
<div class="tags">
|
120
|
-
|
121
|
-
|
122
|
-
</div>
|
123
|
-
</dt>
|
124
|
-
<dd><pre class="code"><span class='kw'>nil</span></pre></dd>
|
125
|
-
|
126
|
-
</dl>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<h2>
|
137
|
-
Class Method Summary
|
138
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
139
|
-
</h2>
|
140
|
-
|
141
|
-
<ul class="summary">
|
142
|
-
|
143
|
-
<li class="public ">
|
144
|
-
<span class="summary_signature">
|
145
|
-
|
146
|
-
<a href="#client-class_method" title="client (class method)">+ (Object) <strong>client</strong> </a>
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
</span>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
<span class="private note title">private</span>
|
158
|
-
|
159
|
-
|
160
|
-
<span class="summary_desc"><div class='inline'>
|
161
|
-
<p>Get the singleton client.</p>
|
162
|
-
</div></span>
|
163
|
-
|
164
|
-
</li>
|
165
|
-
|
166
|
-
|
167
|
-
<li class="public ">
|
168
|
-
<span class="summary_signature">
|
169
|
-
|
170
|
-
<a href="#init-class_method" title="init (class method)">+ (Object) <strong>init</strong>(options) </a>
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
</span>
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
<span class="summary_desc"><div class='inline'>
|
185
|
-
<p>Initialize the SDK.</p>
|
186
|
-
</div></span>
|
187
|
-
|
188
|
-
</li>
|
189
|
-
|
190
|
-
|
191
|
-
<li class="public ">
|
192
|
-
<span class="summary_signature">
|
193
|
-
|
194
|
-
<a href="#root-class_method" title="root (class method)">+ (Object) <strong>root</strong> </a>
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
</span>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
<span class="private note title">private</span>
|
206
|
-
|
207
|
-
|
208
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
209
|
-
|
210
|
-
</li>
|
211
|
-
|
212
|
-
|
213
|
-
</ul>
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
<div id="class_method_details" class="method_details_list">
|
219
|
-
<h2>Class Method Details</h2>
|
220
|
-
|
221
|
-
|
222
|
-
<div class="method_details first">
|
223
|
-
<h3 class="signature first" id="client-class_method">
|
224
|
-
|
225
|
-
+ (<tt><span class='object_link'><a href="Built/Object.html" title="Built::Object (class)">Object</a></span></tt>) <strong>client</strong>
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
</h3><div class="docstring">
|
232
|
-
<div class="discussion">
|
233
|
-
<p class="note private">
|
234
|
-
<strong>This method is part of a private API.</strong>
|
235
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
236
|
-
</p>
|
237
|
-
|
238
|
-
<p>Get the singleton client</p>
|
239
|
-
|
240
|
-
|
241
|
-
</div>
|
242
|
-
</div>
|
243
|
-
<div class="tags">
|
244
|
-
|
245
|
-
|
246
|
-
</div><table class="source_code">
|
247
|
-
<tr>
|
248
|
-
<td>
|
249
|
-
<pre class="lines">
|
250
|
-
|
251
|
-
|
252
|
-
44
|
253
|
-
45
|
254
|
-
46
|
255
|
-
47
|
256
|
-
48
|
257
|
-
49
|
258
|
-
50</pre>
|
259
|
-
</td>
|
260
|
-
<td>
|
261
|
-
<pre class="code"><span class="info file"># File 'lib/built.rb', line 44</span>
|
262
|
-
|
263
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_client'>client</span>
|
264
|
-
<span class='kw'>if</span> <span class='op'>!</span><span class='cvar'>@@client</span>
|
265
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>BuiltError</span><span class='comma'>,</span> <span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>not_initialized</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
266
|
-
<span class='kw'>end</span>
|
267
|
-
|
268
|
-
<span class='cvar'>@@client</span>
|
269
|
-
<span class='kw'>end</span></pre>
|
270
|
-
</td>
|
271
|
-
</tr>
|
272
|
-
</table>
|
273
|
-
</div>
|
274
|
-
|
275
|
-
<div class="method_details ">
|
276
|
-
<h3 class="signature " id="init-class_method">
|
277
|
-
|
278
|
-
+ (<tt><span class='object_link'><a href="Built/Object.html" title="Built::Object (class)">Object</a></span></tt>) <strong>init</strong>(options)
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
</h3><div class="docstring">
|
285
|
-
<div class="discussion">
|
286
|
-
|
287
|
-
<p>Initialize the SDK</p>
|
288
|
-
|
289
|
-
|
290
|
-
</div>
|
291
|
-
</div>
|
292
|
-
<div class="tags">
|
293
|
-
<p class="tag_title">Parameters:</p>
|
294
|
-
<ul class="param">
|
295
|
-
|
296
|
-
<li>
|
297
|
-
|
298
|
-
<span class='name'>options</span>
|
299
|
-
|
300
|
-
|
301
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
—
|
306
|
-
<div class='inline'>
|
307
|
-
<p>Options</p>
|
308
|
-
</div>
|
309
|
-
|
310
|
-
</li>
|
311
|
-
|
312
|
-
</ul>
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
318
|
-
<ul class="option">
|
319
|
-
|
320
|
-
<li>
|
321
|
-
<span class="name">:application_api_key</span>
|
322
|
-
<span class="type">(<tt>String</tt>)</span>
|
323
|
-
<span class="default">
|
324
|
-
|
325
|
-
</span>
|
326
|
-
|
327
|
-
— <div class='inline'>
|
328
|
-
<p>Your app’s api_key. Required.</p>
|
329
|
-
</div>
|
330
|
-
|
331
|
-
</li>
|
332
|
-
|
333
|
-
<li>
|
334
|
-
<span class="name">:master_key</span>
|
335
|
-
<span class="type">(<tt>String</tt>)</span>
|
336
|
-
<span class="default">
|
337
|
-
|
338
|
-
</span>
|
339
|
-
|
340
|
-
— <div class='inline'>
|
341
|
-
<p>Your app’s master_key</p>
|
342
|
-
</div>
|
343
|
-
|
344
|
-
</li>
|
345
|
-
|
346
|
-
<li>
|
347
|
-
<span class="name">:authtoken</span>
|
348
|
-
<span class="type">(<tt>String</tt>)</span>
|
349
|
-
<span class="default">
|
350
|
-
|
351
|
-
</span>
|
352
|
-
|
353
|
-
— <div class='inline'>
|
354
|
-
<p>A user’s authtoken</p>
|
355
|
-
</div>
|
356
|
-
|
357
|
-
</li>
|
358
|
-
|
359
|
-
<li>
|
360
|
-
<span class="name">:host</span>
|
361
|
-
<span class="type">(<tt>String</tt>)</span>
|
362
|
-
<span class="default">
|
363
|
-
|
364
|
-
</span>
|
365
|
-
|
366
|
-
— <div class='inline'>
|
367
|
-
<p>built.io API host (defaults to <a
|
368
|
-
href="https://api.built.io">api.built.io</a>)</p>
|
369
|
-
</div>
|
370
|
-
|
371
|
-
</li>
|
372
|
-
|
373
|
-
<li>
|
374
|
-
<span class="name">:version</span>
|
375
|
-
<span class="type">(<tt>String</tt>)</span>
|
376
|
-
<span class="default">
|
377
|
-
|
378
|
-
</span>
|
379
|
-
|
380
|
-
— <div class='inline'>
|
381
|
-
<p>built.io version delimiter (v1, v2, etc)</p>
|
382
|
-
</div>
|
383
|
-
|
384
|
-
</li>
|
385
|
-
|
386
|
-
</ul>
|
387
|
-
|
388
|
-
|
389
|
-
<p class="tag_title">Raises:</p>
|
390
|
-
<ul class="raise">
|
391
|
-
|
392
|
-
<li>
|
393
|
-
|
394
|
-
|
395
|
-
<span class='type'>(<tt><span class='object_link'><a href="Built/BuiltError.html" title="Built::BuiltError (class)">BuiltError</a></span></tt>)</span>
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
</li>
|
400
|
-
|
401
|
-
</ul>
|
402
|
-
|
403
|
-
</div><table class="source_code">
|
404
|
-
<tr>
|
405
|
-
<td>
|
406
|
-
<pre class="lines">
|
407
|
-
|
408
|
-
|
409
|
-
18
|
410
|
-
19
|
411
|
-
20
|
412
|
-
21
|
413
|
-
22
|
414
|
-
23
|
415
|
-
24
|
416
|
-
25
|
417
|
-
26
|
418
|
-
27
|
419
|
-
28
|
420
|
-
29
|
421
|
-
30
|
422
|
-
31
|
423
|
-
32
|
424
|
-
33
|
425
|
-
34
|
426
|
-
35
|
427
|
-
36
|
428
|
-
37
|
429
|
-
38
|
430
|
-
39
|
431
|
-
40</pre>
|
432
|
-
</td>
|
433
|
-
<td>
|
434
|
-
<pre class="code"><span class="info file"># File 'lib/built.rb', line 18</span>
|
435
|
-
|
436
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_init'>init</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
437
|
-
<span class='id identifier rubyid_options'>options</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
438
|
-
|
439
|
-
<span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:host</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>API_URI</span>
|
440
|
-
<span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:version</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>API_VERSION</span>
|
441
|
-
<span class='id identifier rubyid_master_key'>master_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:master_key</span><span class='rbracket'>]</span>
|
442
|
-
<span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:application_api_key</span><span class='rbracket'>]</span>
|
443
|
-
<span class='id identifier rubyid_authtoken'>authtoken</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:authtoken</span><span class='rbracket'>]</span>
|
444
|
-
|
445
|
-
<span class='kw'>if</span> <span class='const'>Util</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_api_key'>api_key</span><span class='rparen'>)</span>
|
446
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>BuiltError</span><span class='comma'>,</span> <span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span>
|
447
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required_parameter</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:param</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>application_api_key</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
448
|
-
<span class='kw'>end</span>
|
449
|
-
|
450
|
-
<span class='comment'># create the client
|
451
|
-
</span> <span class='cvar'>@@client</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><span class='lbrace'>{</span>
|
452
|
-
<span class='label'>host:</span> <span class='id identifier rubyid_host'>host</span><span class='comma'>,</span>
|
453
|
-
<span class='label'>version:</span> <span class='id identifier rubyid_version'>version</span><span class='comma'>,</span>
|
454
|
-
<span class='label'>application_api_key:</span> <span class='id identifier rubyid_api_key'>api_key</span><span class='comma'>,</span>
|
455
|
-
<span class='label'>master_key:</span> <span class='id identifier rubyid_master_key'>master_key</span><span class='comma'>,</span>
|
456
|
-
<span class='label'>authtoken:</span> <span class='id identifier rubyid_authtoken'>authtoken</span>
|
457
|
-
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
458
|
-
<span class='kw'>end</span></pre>
|
459
|
-
</td>
|
460
|
-
</tr>
|
461
|
-
</table>
|
462
|
-
</div>
|
463
|
-
|
464
|
-
<div class="method_details ">
|
465
|
-
<h3 class="signature " id="root-class_method">
|
466
|
-
|
467
|
-
+ (<tt><span class='object_link'><a href="Built/Object.html" title="Built::Object (class)">Object</a></span></tt>) <strong>root</strong>
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
</h3><div class="docstring">
|
474
|
-
<div class="discussion">
|
475
|
-
<p class="note private">
|
476
|
-
<strong>This method is part of a private API.</strong>
|
477
|
-
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
478
|
-
</p>
|
479
|
-
|
480
|
-
|
481
|
-
</div>
|
482
|
-
</div>
|
483
|
-
<div class="tags">
|
484
|
-
|
485
|
-
|
486
|
-
</div><table class="source_code">
|
487
|
-
<tr>
|
488
|
-
<td>
|
489
|
-
<pre class="lines">
|
490
|
-
|
491
|
-
|
492
|
-
53
|
493
|
-
54
|
494
|
-
55</pre>
|
495
|
-
</td>
|
496
|
-
<td>
|
497
|
-
<pre class="code"><span class="info file"># File 'lib/built.rb', line 53</span>
|
498
|
-
|
499
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_root'>root</span>
|
500
|
-
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>..</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>__FILE__</span>
|
501
|
-
<span class='kw'>end</span></pre>
|
502
|
-
</td>
|
503
|
-
</tr>
|
504
|
-
</table>
|
505
|
-
</div>
|
506
|
-
|
507
|
-
</div>
|
508
|
-
|
509
|
-
</div>
|
510
|
-
|
511
|
-
<div id="footer">
|
512
|
-
Generated on Mon Mar 24 18:29:44 2014 by
|
513
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
514
|
-
0.8.7.2 (ruby-1.9.3).
|
515
|
-
</div>
|
516
|
-
|
517
|
-
</body>
|
518
|
-
</html>
|