summaryrefslogtreecommitdiff
path: root/users/app/models/service_level.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-12-03 12:17:51 -0800
committerjessib <jessib@riseup.net>2013-12-03 12:17:51 -0800
commit35761333404e3cc2c93bca23036d0fd8e47fd10b (patch)
tree5a35ce7c97acca76302955750cfb4b6772bf0f83 /users/app/models/service_level.rb
parent2a2ffd46bf4e6009f2957fb4e4abdedbfa7e3245 (diff)
Add ServiceLevel class to wrap config and give accessors. Has some hacky parts, but seems like okay generic start for now.
Diffstat (limited to 'users/app/models/service_level.rb')
-rw-r--r--users/app/models/service_level.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/users/app/models/service_level.rb b/users/app/models/service_level.rb
new file mode 100644
index 0000000..ac5244f
--- /dev/null
+++ b/users/app/models/service_level.rb
@@ -0,0 +1,31 @@
+class ServiceLevel
+
+ def initialize(attributes = {})
+ @level = attributes[:level] || APP_CONFIG[:default_service_level]
+ end
+
+ def level
+ @level
+ end
+
+ def name
+ APP_CONFIG[:service_levels][@level][:name]
+ end
+
+ def cert_prefix
+ APP_CONFIG[:service_levels][@level][:cert_prefix]
+ end
+
+ def description
+ APP_CONFIG[:service_levels][@level][:description]
+ end
+
+ def cost
+ APP_CONFIG[:service_levels][@level][:cost]
+ end
+
+ def quota
+ APP_CONFIG[:service_levels][@level][:quota]
+ end
+
+end