Class: Hackle::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/hackle/internal/model/container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, bucket_id:, groups:) ⇒ Container

Returns a new instance of Container.

Parameters:



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_idInteger (readonly)

Returns:

  • (Integer)


12
# File 'lib/hackle/internal/model/container.rb', line 12

attr_reader :id, :bucket_id, :groups

#groupsObject (readonly)

Returns the value of attribute groups.



12
# File 'lib/hackle/internal/model/container.rb', line 12

attr_reader :id, :bucket_id, :groups

#idInteger (readonly)

Returns:

  • (Integer)


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?

Parameters:

  • group_id (Integer)

Returns:



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