Class: RumbleBundle::Bundle

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBundle

Returns a new instance of Bundle.



11
12
13
# File 'lib/rumble_bundle/bundle.rb', line 11

def initialize
  self.class.all << self
end

Instance Attribute Details

#charitiesObject

Returns the value of attribute charities.



3
4
5
# File 'lib/rumble_bundle/bundle.rb', line 3

def charities
  @charities
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/rumble_bundle/bundle.rb', line 3

def name
  @name
end

#tiersObject

Returns the value of attribute tiers.



3
4
5
# File 'lib/rumble_bundle/bundle.rb', line 3

def tiers
  @tiers
end

#total_msrpObject

Returns the value of attribute total_msrp.



3
4
5
# File 'lib/rumble_bundle/bundle.rb', line 3

def total_msrp
  @total_msrp
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/rumble_bundle/bundle.rb', line 3

def url
  @url
end

Class Method Details

.allObject



7
8
9
# File 'lib/rumble_bundle/bundle.rb', line 7

def self.all
  @@all
end

Instance Method Details

#productsObject



15
16
17
18
# File 'lib/rumble_bundle/bundle.rb', line 15

def products
  # Leverage Bundle#tiers to expose a flat array of a Bundle's Products.
  self.tiers.collect{|t| t.products}.flatten
end