Class: Polyn::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/polyn/configuration.rb

Overview

Configuration data for Polyn

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
# File 'lib/polyn/configuration.rb', line 7

def initialize
  @domain      = nil
  @source_root = nil
  @polyn_env   = ENV["POLYN_ENV"] || ENV["RAILS_ENV"] || "development"
end

Instance Attribute Details

#polyn_envObject (readonly)

Returns the value of attribute polyn_env.



13
14
15
# File 'lib/polyn/configuration.rb', line 13

def polyn_env
  @polyn_env
end

Instance Method Details

#domainObject



15
16
17
# File 'lib/polyn/configuration.rb', line 15

def domain
  @domain ||= Polyn::Naming.validate_domain_name!(@domain)
end

#domain=(name) ⇒ Object



19
20
21
22
# File 'lib/polyn/configuration.rb', line 19

def domain=(name)
  Polyn::Naming.validate_domain_name!(name)
  @domain = name
end

#source_rootObject



24
25
26
# File 'lib/polyn/configuration.rb', line 24

def source_root
  @source_root ||= Polyn::Naming.validate_source_root!(@source_root)
end

#source_root=(name) ⇒ Object



28
29
30
31
# File 'lib/polyn/configuration.rb', line 28

def source_root=(name)
  Polyn::Naming.validate_source_root!(name)
  @source_root = name
end