Class: RedSnapper::Group
- Inherits:
-
Object
- Object
- RedSnapper::Group
- Defined in:
- lib/redsnapper.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #add(name, size) ⇒ Object
-
#initialize ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize ⇒ Group
Returns a new instance of Group.
11 12 13 14 |
# File 'lib/redsnapper.rb', line 11 def initialize @files = [] @size = 0 end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
10 11 12 |
# File 'lib/redsnapper.rb', line 10 def files @files end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
10 11 12 |
# File 'lib/redsnapper.rb', line 10 def size @size end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/redsnapper.rb', line 19 def <=>(other) other.size <=> size end |
#add(name, size) ⇒ Object
15 16 17 18 |
# File 'lib/redsnapper.rb', line 15 def add(name, size) @files << name @size += size end |