Module: Parse
- Defined in:
- lib/parsecom.rb,
lib/parse/acl.rb,
lib/parse/date.rb,
lib/parse/file.rb,
lib/parse/role.rb,
lib/parse/user.rb,
lib/parse/util.rb,
lib/parse/batch.rb,
lib/parse/event.rb,
lib/parse/query.rb,
lib/parse/client.rb,
lib/parse/object.rb,
lib/parse/op/add.rb,
lib/parse/pointer.rb,
lib/parse/version.rb,
lib/parse/relation.rb,
lib/parse/geo_point.rb,
lib/parse/op/delete.rb,
lib/parse/op/remove.rb,
lib/parse/cloud_code.rb,
lib/parse/event/error.rb,
lib/parse/http_client.rb,
lib/parse/installation.rb,
lib/parse/op/increment.rb,
lib/parse/op/add_unique.rb,
lib/parse/op/add_relation.rb,
lib/parse/event/app_opened.rb,
lib/parse/batch_http_client.rb,
lib/parse/op/remove_relation.rb
Defined Under Namespace
Modules: Op, Util
Classes: ACL, Batch, BatchHttpClient, Client, Event, GeoPoint, HttpClient, Installation, Object, ParseDate, ParseFile, Pointer, Query, Relation, Role, User
Constant Summary
collapse
- RESERVED_EVENT_CLASS =
{
'AppOpened' => 'Parse::Event::AppOpened',
'Error' => 'Parse::Event::Error'
}
- RESERVED_PARSE_CLASS =
{
'_User' => 'Parse::User',
'_Role' => 'Parse::Role',
'_Installation' => 'Parse::Installation'
}
- VERSION =
"0.5.8"
- @@application_id =
ENV['PARSE_APPLICATION_ID']
- @@api_key =
ENV['PARSE_API_KEY']
- @@master_key =
ENV['PARSE_MASTER_KEY']
- @@auto_snake_case =
false
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
56
57
58
|
# File 'lib/parsecom.rb', line 56
def api_key
@@api_key
end
|
.api_key=(api_key) ⇒ Object
60
61
62
|
# File 'lib/parsecom.rb', line 60
def api_key= api_key
@@api_key = api_key
end
|
.application_id ⇒ Object
48
49
50
|
# File 'lib/parsecom.rb', line 48
def application_id
@@application_id
end
|
.application_id=(application_id) ⇒ Object
52
53
54
|
# File 'lib/parsecom.rb', line 52
def application_id= application_id
@@application_id = application_id
end
|
.auto_snake_case ⇒ Object
82
83
84
|
# File 'lib/parsecom.rb', line 82
def auto_snake_case
@@auto_snake_case
end
|
.auto_snake_case=(auto_snake_case) ⇒ Object
86
87
88
|
# File 'lib/parsecom.rb', line 86
def auto_snake_case= auto_snake_case
@@auto_snake_case = auto_snake_case
end
|
.batch(&block) ⇒ Object
44
45
46
|
# File 'lib/parse/batch.rb', line 44
def self.batch &block
Batch.new(&block).run
end
|
.batch!(&block) ⇒ Object
48
49
50
|
# File 'lib/parse/batch.rb', line 48
def self.batch! &block
Batch.new(&block).run!
end
|
.credentials(hash) ⇒ Object
72
73
74
75
76
|
# File 'lib/parsecom.rb', line 72
def credentials hash
@@application_id = hash[:application_id]
@@api_key = hash[:api_key]
@@master_key = hash[:master_key]
end
|
.credentials=(hash) ⇒ Object
78
79
80
|
# File 'lib/parsecom.rb', line 78
def credentials= hash
credentials hash
end
|
.master_key ⇒ Object
64
65
66
|
# File 'lib/parsecom.rb', line 64
def master_key
@@master_key
end
|
.master_key=(master_key) ⇒ Object
68
69
70
|
# File 'lib/parsecom.rb', line 68
def master_key= master_key
@@master_key = master_key
end
|
.Object(parse_class_name, mod = ::Object) ⇒ Object
create or get ParseObject class in the given module
Parameters:
- parse_class_name
-
Parse class name
- mod
-
module where ParseObject is populated
Returns:
subclass of ParseObject for the given parse_class_name
316
317
318
319
320
321
322
323
324
|
# File 'lib/parse/object.rb', line 316
def self.Object parse_class_name, mod=::Object
if RESERVED_PARSE_CLASS.has_key? parse_class_name.to_s
eval RESERVED_PARSE_CLASS[parse_class_name.to_s]
else
Parse::Object.create parse_class_name, mod \
unless mod.const_defined? parse_class_name
mod.const_get parse_class_name
end
end
|
.use_master_key! ⇒ Object
90
91
92
|
# File 'lib/parsecom.rb', line 90
def use_master_key!
Parse::Client.default.use_master_key!
end
|
Instance Method Details
#Query(parse_class_name = nil) ⇒ Object
352
353
354
|
# File 'lib/parse/query.rb', line 352
def Query parse_class_name=nil
Query.new parse_class_name
end
|