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.
14 15 16 17 |
# File 'lib/redsnapper.rb', line 14 def initialize @files = [] @size = 0 end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
13 14 15 |
# File 'lib/redsnapper.rb', line 13 def files @files end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
13 14 15 |
# File 'lib/redsnapper.rb', line 13 def size @size end |
Instance Method Details
#<=>(other) ⇒ Object
22 23 24 |
# File 'lib/redsnapper.rb', line 22 def <=>(other) other.size <=> size end |
#add(name, size) ⇒ Object
18 19 20 21 |
# File 'lib/redsnapper.rb', line 18 def add(name, size) @files << name @size += size end |