Module: Parse
- Defined in:
- lib/parsecom.rb,
lib/parse/acl.rb,
lib/parse/date.rb,
lib/parse/file.rb,
lib/parse/push.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, Push, 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.7.0"
- @@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
58
59
60
|
# File 'lib/parsecom.rb', line 58
def api_key
@@api_key
end
|
.api_key=(api_key) ⇒ Object
62
63
64
|
# File 'lib/parsecom.rb', line 62
def api_key= api_key
@@api_key = api_key
end
|
.application_id ⇒ Object
50
51
52
|
# File 'lib/parsecom.rb', line 50
def application_id
@@application_id
end
|
.application_id=(application_id) ⇒ Object
54
55
56
|
# File 'lib/parsecom.rb', line 54
def application_id= application_id
@@application_id = application_id
end
|
.auto_snake_case ⇒ Object
84
85
86
|
# File 'lib/parsecom.rb', line 84
def auto_snake_case
@@auto_snake_case
end
|
.auto_snake_case=(auto_snake_case) ⇒ Object
88
89
90
|
# File 'lib/parsecom.rb', line 88
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
74
75
76
77
78
|
# File 'lib/parsecom.rb', line 74
def credentials hash
@@application_id = hash[:application_id]
@@api_key = hash[:api_key]
@@master_key = hash[:master_key]
end
|
.credentials=(hash) ⇒ Object
80
81
82
|
# File 'lib/parsecom.rb', line 80
def credentials= hash
credentials hash
end
|
.date(*args) ⇒ Object
52
53
54
|
# File 'lib/parse/date.rb', line 52
def date *args
ParseDate.parse *args
end
|
96
97
98
|
# File 'lib/parsecom.rb', line 96
def dry_run!
Parse::Client.default.dry_run!
end
|
.master_key ⇒ Object
66
67
68
|
# File 'lib/parsecom.rb', line 66
def master_key
@@master_key
end
|
.master_key=(master_key) ⇒ Object
70
71
72
|
# File 'lib/parsecom.rb', line 70
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
333
334
335
336
337
338
339
340
341
|
# File 'lib/parse/object.rb', line 333
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
92
93
94
|
# File 'lib/parsecom.rb', line 92
def use_master_key!
Parse::Client.default.use_master_key!
end
|
Instance Method Details
#Query(parse_class_name = nil) ⇒ Object
373
374
375
|
# File 'lib/parse/query.rb', line 373
def Query parse_class_name=nil
Query.new parse_class_name
end
|