Class: Rox::Core::TargetGroupRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/core/repositories/target_group_repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTargetGroupRepository

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

Parameters:

  • value

    the value to set the attribute target_groups to.



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