lib/eventbrite/api_object.rb
# Loads attributes and relations from a hash, 
# or makes an API call to retrieve necessary data if load hash is empty
#
# The no_dirty attribute allows you to force a dirty tracking to recognize
# the object as clean.
Loads attributes and relations from a hash,
or makes an API call to retrieve necessary data if load hash is empty

The no_dirty attribute allows you to force a dirty tracking to recognize
the object as clean.
Loads attributes and relations from a hash or makes an API call to retrieve necessary data if load hash is empty The no_dirty attribute allows you to force a dirty tracking to recognize the object as clean .
def load(hash = {}, no_dirty = false)
      if hash.nil? || hash.size == 0
        response = Eventbrite.call("#{self.class.singlet_name}_get", prep_api_hash('get'))
        hash = response["#{self.class.singlet_name}"]
      end
      unless hash.nil? || hash.size == 0
        init_with_hash(hash, no_dirty)
        load_relations_with_hash(hash, no_dirty)
        load_collections_with_hash(hash, no_dirty)
      end
      clean! if no_dirty
      after_load(hash)
    end
def load ( hash = { } , no_dirty = false ) if hash . nil? || hash . size == 0 response = Eventbrite . call ( "#{self.class.singlet_name}_get" , prep_api_hash ( 'get' ) ) hash = response [ "#{self.class.singlet_name}" ] end unless hash . nil? || hash . size == 0 init_with_hash ( hash , no_dirty ) load_relations_with_hash ( hash , no_dirty ) load_collections_with_hash ( hash , no_dirty ) end clean! if no_dirty after_load ( hash ) end
Loads attributes and relations from a hash,
or makes an API call to retrieve necessary data if load hash is empty
Loads attributes and relations from a hash or makes an API call to retrieve necessary data if load hash is empty
hash
<not_specific>
no_dirty
<not_specific>