This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in application.rb | |
config.to_prepare do | |
Devise::Mailer.layout "email_template" # in views/layouts | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to do it we have to define === method inside our class | |
class Ticket | |
attr_accessor :venue, :date, :price | |
def initialize(venue, date, price) | |
self.venue = venue | |
self.date = date | |
self.price = price |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to use this module the class has to mixin it and define <=> method | |
class Bid | |
include Comparable | |
attr_accessor :estimate | |
def <=>(other_bid) | |
if self.estimate > other_bid.estimate | |
1 |
NewerOlder