Module: PhoneGap::Build::Creatable::ClassMethods

Defined in:
lib/phone_gap/build/creatable.rb

Instance Method Summary collapse

Instance Method Details

#add_to_collection(collection_name, value) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/phone_gap/build/creatable.rb', line 30

def add_to_collection(collection_name, value)
  if self.class_variable_get(collection_name)[self]
    self.class_variable_get(collection_name)[self] << "@#{value}"
  else
    self.class_variable_get(collection_name)[self] = ["@#{value}"]
  end
end

#attr_creatable(*args) ⇒ Object



22
23
24
# File 'lib/phone_gap/build/creatable.rb', line 22

def attr_creatable(*args)
  args.each { |attribute| add_to_collection('@@creatable_attributes', attribute) }
end

#attr_updatable(*args) ⇒ Object



26
27
28
# File 'lib/phone_gap/build/creatable.rb', line 26

def attr_updatable(*args)
  args.each { |attribute| add_to_collection('@@updatable_attributes', attribute) }
end