Class: Hackle::Container
- Inherits:
-
Object
- Object
- Hackle::Container
- Defined in:
- lib/hackle/internal/model/container.rb
Instance Attribute Summary collapse
- #bucket_id ⇒ Integer readonly
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
- #id ⇒ Integer readonly
Instance Method Summary collapse
- #get_group_or_nil(group_id) ⇒ ContainerGroup?
-
#initialize(id:, bucket_id:, groups:) ⇒ Container
constructor
A new instance of Container.
Constructor Details
#initialize(id:, bucket_id:, groups:) ⇒ Container
Returns a new instance of Container.
17 18 19 20 21 |
# File 'lib/hackle/internal/model/container.rb', line 17 def initialize(id:, bucket_id:, groups:) @id = id @bucket_id = bucket_id @groups = groups end |
Instance Attribute Details
#bucket_id ⇒ Integer (readonly)
12 |
# File 'lib/hackle/internal/model/container.rb', line 12 attr_reader :id, :bucket_id, :groups |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
12 |
# File 'lib/hackle/internal/model/container.rb', line 12 attr_reader :id, :bucket_id, :groups |
#id ⇒ Integer (readonly)
12 13 14 |
# File 'lib/hackle/internal/model/container.rb', line 12 def id @id end |
Instance Method Details
#get_group_or_nil(group_id) ⇒ ContainerGroup?
25 26 27 28 29 30 |
# File 'lib/hackle/internal/model/container.rb', line 25 def get_group_or_nil(group_id) groups.each do |group| return group if group.id == group_id end nil end |