Created
January 31, 2012 03:56
-
-
Save baldwindavid/1708678 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Plan | |
PLANS = [ | |
{ | |
:id => 1, | |
:name => "Individual", | |
:can_send => true, | |
:amount => "???", | |
:interval => "month", | |
:trial_period_days => 30, | |
:max_collaborators => 1 | |
}, | |
{ | |
:id => 2, | |
:name => "Small Team", | |
:can_send => true, | |
:amount => "???", | |
:interval => "month", | |
:trial_period_days => 30, | |
:max_collaborators => 3 | |
} | |
] | |
attr_accessor :id, :name, :can_send, :amount, :interval, :trial_period_days, :max_collaborators | |
def initialize(attrs = {}) | |
attrs.each do |k, v| | |
self.send "#{k}=", v | |
end | |
end | |
def self.all | |
PLANS.collect do |plan| | |
new plan | |
end | |
end | |
def self.find(_id) | |
all.select {|p| p.id == _id}.first | |
end | |
def can_send? | |
can_send | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment