Class: BookDeals::Deal

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

Overview

current deal on the book

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(price, original_price = nil, expires_in = nil) ⇒ Deal

Returns a new instance of Deal.



7
8
9
10
11
# File 'lib/book_deals/deal.rb', line 7

def initialize(price, original_price = nil, expires_in = nil)
  self.price = price
  self.original_price = original_price
  self.expires_in = expires_in
end

Instance Attribute Details

#expires_inObject

Returns the value of attribute expires_in.



5
6
7
# File 'lib/book_deals/deal.rb', line 5

def expires_in
  @expires_in
end

#original_priceObject

Returns the value of attribute original_price.



5
6
7
# File 'lib/book_deals/deal.rb', line 5

def original_price
  @original_price
end

#priceObject

Returns the value of attribute price.



5
6
7
# File 'lib/book_deals/deal.rb', line 5

def price
  @price
end