Class: SubdomainFu::Configuration

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

Constant Summary

@@defaults =
{
  :tld_sizes => { :development => 0, :test => 0, :production => 1 }.freeze,
  :mirrors => %w(www).freeze,
  :preferred_mirror => nil,
  :override_only_path => false
}.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



39
40
41
42
43
# File 'lib/subdomain_fu/subdomain_fu.rb', line 39

def initialize
  @@defaults.each_pair do |k, v|
    self.send("#{k}=", (v.dup rescue v))
  end
end

Instance Attribute Details

#mirrorsObject

Returns the value of attribute mirrors



30
31
32
# File 'lib/subdomain_fu/subdomain_fu.rb', line 30

def mirrors
  @mirrors
end

#override_only_pathObject

Returns the value of attribute override_only_path



30
31
32
# File 'lib/subdomain_fu/subdomain_fu.rb', line 30

def override_only_path
  @override_only_path
end

#preferred_mirrorObject

Returns the value of attribute preferred_mirror



30
31
32
# File 'lib/subdomain_fu/subdomain_fu.rb', line 30

def preferred_mirror
  @preferred_mirror
end

#tld_sizesObject

Returns the value of attribute tld_sizes



30
31
32
# File 'lib/subdomain_fu/subdomain_fu.rb', line 30

def tld_sizes
  @tld_sizes
end

Class Method Details

.defaultsObject



45
46
47
# File 'lib/subdomain_fu/subdomain_fu.rb', line 45

def self.defaults
  @@defaults
end

Instance Method Details

#tld_sizeObject



53
54
55
# File 'lib/subdomain_fu/subdomain_fu.rb', line 53

def tld_size
  tld_sizes[Rails.env.to_sym]
end

#tld_size=(size) ⇒ Object



49
50
51
# File 'lib/subdomain_fu/subdomain_fu.rb', line 49

def tld_size=(size)
  tld_sizes[Rails.env.to_sym] = size
end