Class: SubdomainFu::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/subdomain-fu.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration


41
42
43
44
45
# File 'lib/subdomain-fu.rb', line 41

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

Instance Attribute Details

#mirrorsObject

Returns the value of attribute mirrors


32
33
34
# File 'lib/subdomain-fu.rb', line 32

def mirrors
  @mirrors
end

#override_only_pathObject

Returns the value of attribute override_only_path


32
33
34
# File 'lib/subdomain-fu.rb', line 32

def override_only_path
  @override_only_path
end

#preferred_mirrorObject

Returns the value of attribute preferred_mirror


32
33
34
# File 'lib/subdomain-fu.rb', line 32

def preferred_mirror
  @preferred_mirror
end

#tld_sizesObject

Returns the value of attribute tld_sizes


32
33
34
# File 'lib/subdomain-fu.rb', line 32

def tld_sizes
  @tld_sizes
end

Instance Method Details

#tld_sizeObject


51
52
53
# File 'lib/subdomain-fu.rb', line 51

def tld_size
  tld_sizes[Rails.env.to_sym]
end

#tld_size=(size) ⇒ Object


47
48
49
# File 'lib/subdomain-fu.rb', line 47

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