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.



19
20
21
22
# File 'lib/redsnapper.rb', line 19

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

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



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

def files
  @files
end

#sizeObject (readonly)

Returns the value of attribute size.



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

def size
  @size
end

Instance Method Details

#<=>(other) ⇒ Object



27
28
29
# File 'lib/redsnapper.rb', line 27

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

#add(name, size) ⇒ Object



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

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