Class: Polar::Groups
- Inherits:
-
Object
- Object
- Polar::Groups
- Defined in:
- lib/polar/groups.rb
Instance Attribute Summary collapse
-
#defined_groups_store ⇒ Object
Returns the value of attribute defined_groups_store.
-
#subject_store ⇒ Object
Returns the value of attribute subject_store.
Class Method Summary collapse
- .define(&block) ⇒ Object
- .defined_store ⇒ Object
- .instance ⇒ Object
- .method_missing(method) {|GroupHash.new(method)| ... } ⇒ Object
Instance Method Summary collapse
- #fill_subject_from_external_store(subject_id, storage) ⇒ Object
-
#initialize(instance_object = false) ⇒ Groups
constructor
A new instance of Groups.
Constructor Details
#initialize(instance_object = false) ⇒ Groups
Returns a new instance of Groups.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/polar/groups.rb', line 22 def initialize(instance_object = false) @defined_groups_store ||= [] @subject_store ||= [] unless instance_object @defined_groups_store = self.class.instance.defined_groups_store.clone @subject_store = self.class.instance.subject_store.clone end self end |
Instance Attribute Details
#defined_groups_store ⇒ Object
Returns the value of attribute defined_groups_store.
19 20 21 |
# File 'lib/polar/groups.rb', line 19 def defined_groups_store @defined_groups_store end |
#subject_store ⇒ Object
Returns the value of attribute subject_store.
20 21 22 |
# File 'lib/polar/groups.rb', line 20 def subject_store @subject_store end |
Class Method Details
.define(&block) ⇒ Object
37 38 39 |
# File 'lib/polar/groups.rb', line 37 def self.define(&block) self end |
.defined_store ⇒ Object
45 46 47 |
# File 'lib/polar/groups.rb', line 45 def self.defined_store @defined_groups_store ||= {} end |
.instance ⇒ Object
33 34 35 |
# File 'lib/polar/groups.rb', line 33 def self.instance @__instance__ ||= new(true) end |
Instance Method Details
#fill_subject_from_external_store(subject_id, storage) ⇒ Object
49 50 51 52 53 |
# File 'lib/polar/groups.rb', line 49 def fill_subject_from_external_store(subject_id, storage) storage.get_for_subject(subject_id).each do |group| self.subject_store << group.group_name.to_sym end end |