Module: Parse

Defined in:
lib/parsecom.rb,
lib/parse/file.rb,
lib/parse/user.rb,
lib/parse/query.rb,
lib/parse/client.rb,
lib/parse/object.rb,
lib/parse/pointer.rb,
lib/parse/version.rb,
lib/parse/cloud_code.rb,
lib/parse/http_client.rb

Defined Under Namespace

Classes: Client, File, HttpClient, Object, Pointer, Query, User

Constant Summary collapse

RESERVED_PARSE_CLASS =
{
  '_User' => 'Parse::User'
}
VERSION =
"0.0.2"
@@application_id =
nil
@@api_key =
nil
@@auto_snake_case =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.api_keyObject



34
35
36
# File 'lib/parsecom.rb', line 34

def api_key
  @@api_key
end

.api_key=(api_key) ⇒ Object



38
39
40
# File 'lib/parsecom.rb', line 38

def api_key= api_key
  @@api_key = api_key
end

.application_idObject



26
27
28
# File 'lib/parsecom.rb', line 26

def application_id
  @@application_id
end

.application_id=(application_id) ⇒ Object



30
31
32
# File 'lib/parsecom.rb', line 30

def application_id= application_id
  @@application_id = application_id
end

.auto_snake_caseObject



51
52
53
# File 'lib/parsecom.rb', line 51

def auto_snake_case
  @@auto_snake_case
end

.auto_snake_case=(auto_snake_case) ⇒ Object



55
56
57
# File 'lib/parsecom.rb', line 55

def auto_snake_case= auto_snake_case
  @@auto_snake_case = auto_snake_case
end

.credentials(hash) ⇒ Object



42
43
44
45
# File 'lib/parsecom.rb', line 42

def credentials hash
  @@application_id = hash[:application_id]
  @@api_key = hash[:api_key]
end

.credentials=(hash) ⇒ Object



47
48
49
# File 'lib/parsecom.rb', line 47

def credentials= hash
  credentials hash
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



180
181
182
183
184
185
186
187
188
# File 'lib/parse/object.rb', line 180

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

Instance Method Details

#Query(parse_class_name = nil) ⇒ Object



283
284
285
# File 'lib/parse/query.rb', line 283

def Query parse_class_name=nil
  Query.new parse_class_name
end