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

- (Configuration) initialize



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

- (Object) mirrors

Returns the value of attribute mirrors



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

def mirrors
  @mirrors
end

- (Object) override_only_path

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

- (Object) preferred_mirror

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

- (Object) tld_sizes

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

+ (Object) defaults



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

def self.defaults
  @@defaults
end

Instance Method Details

- (Object) tld_size



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

def tld_size
  tld_sizes[Rails.env.to_sym]
end

- (Object) tld_size=(size)



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

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