Class: Rox::Core::TargetGroupRepository
- Inherits:
-
Object
- Object
- Rox::Core::TargetGroupRepository
- Defined in:
- lib/rox/core/repositories/target_group_repository.rb
Instance Attribute Summary collapse
-
#target_groups ⇒ Object
writeonly
Sets the attribute target_groups.
Instance Method Summary collapse
-
#initialize ⇒ TargetGroupRepository
constructor
A new instance of TargetGroupRepository.
- #target_group(id) ⇒ Object
Constructor Details
#initialize ⇒ TargetGroupRepository
Returns a new instance of TargetGroupRepository.
4 5 6 |
# File 'lib/rox/core/repositories/target_group_repository.rb', line 4 def initialize @target_groups = [] end |
Instance Attribute Details
#target_groups=(value) ⇒ Object (writeonly)
Sets the attribute target_groups
8 9 10 |
# File 'lib/rox/core/repositories/target_group_repository.rb', line 8 def target_groups=(value) @target_groups = value end |
Instance Method Details
#target_group(id) ⇒ Object
10 11 12 |
# File 'lib/rox/core/repositories/target_group_repository.rb', line 10 def target_group(id) @target_groups.detect { |g| g.id == id } end |