summaryrefslogtreecommitdiff
path: root/users/app/models/service_level.rb
blob: 299aaf1e6e89d92c84be4e62d1b2870e57b9ea2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class ServiceLevel

  def initialize(attributes = {})
    @id = attributes[:id] || APP_CONFIG[:default_service_level]
  end

  def self.authenticated_select_options
    APP_CONFIG[:service_levels].map { |id,config_hash| [config_hash[:description], id] if config_hash[:name] != 'anonymous'}.compact
  end

  def id
    @id
  end

  def config_hash
    APP_CONFIG[:service_levels][@id]
  end

end