Class: RedSnapper::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/redsnapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGroup

Returns a new instance of Group.



17
18
19
20
# File 'lib/redsnapper.rb', line 17

def initialize
  @files = []
  @size = 0
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



16
17
18
# File 'lib/redsnapper.rb', line 16

def files
  @files
end

#sizeObject (readonly)

Returns the value of attribute size.



16
17
18
# File 'lib/redsnapper.rb', line 16

def size
  @size
end

Instance Method Details

#<=>(other) ⇒ Object



25
26
27
# File 'lib/redsnapper.rb', line 25

def <=>(other)
  other.size <=> size
end

#add(name, size) ⇒ Object



21
22
23
24
# File 'lib/redsnapper.rb', line 21

def add(name, size)
  @files << name
  @size += size
end