Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Created January 31, 2012 03:56
Show Gist options
  • Save baldwindavid/1708678 to your computer and use it in GitHub Desktop.
Save baldwindavid/1708678 to your computer and use it in GitHub Desktop.
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