Module: Omega::Client::TrackEntity::ClassMethods

Defined in:
lib/omega/client/mixins/track_entity.rb

Overview

Methods that are defined on the class including the TrackState module

Instance Method Summary collapse

Instance Method Details

#cached(id) ⇒ Object

Return cached entity, else retrieve


67
68
69
70
71
# File 'lib/omega/client/mixins/track_entity.rb', line 67

def cached(id)
  e = entities.find { |e| e.id == id }
  return e unless e.nil?
  self.get id
end

#clear_entitiesObject

Only clear entities on the local type


56
57
58
59
# File 'lib/omega/client/mixins/track_entity.rb', line 56

def clear_entities
  le = entities
  TrackEntity.entities.reject! { |e| le.include?(e) }
end

#entitiesObject

Return all entities of the local type


51
52
53
# File 'lib/omega/client/mixins/track_entity.rb', line 51

def entities
  TrackEntity.entities.select { |e| e.kind_of?(self) }
end

#refreshObject

Refresh all entities


62
63
64
# File 'lib/omega/client/mixins/track_entity.rb', line 62

def refresh
  entities.each { |e| e.refresh }
end