Class: Stringex::Configuration::ActsAsUrl

Inherits:
Base
  • Object
show all
Defined in:
lib/stringex/configuration/acts_as_url.rb

Instance Attribute Summary

Attributes inherited from Base

#settings

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#adapter, configure, system_wide_customizations, unconfigure!

Constructor Details

#initialize(options = {}) ⇒ ActsAsUrl

Returns a new instance of ActsAsUrl.



4
5
6
7
8
9
# File 'lib/stringex/configuration/acts_as_url.rb', line 4

def initialize(options = {})
  if options[:scope]
    options[:scope_for_url] = options.delete(:scope)
  end
  super
end

Class Method Details

.settingsObject



22
23
24
# File 'lib/stringex/configuration/acts_as_url.rb', line 22

def self.settings
  @settings
end

Instance Method Details

#string_extensions_settingsObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/stringex/configuration/acts_as_url.rb', line 11

def string_extensions_settings
  [
    :allow_slash,
    :exclude,
    :force_downcase,
    :limit,
    :replace_whitespace_with,
    :truncate_words
  ].inject(Hash.new){|m, x| m[x] = settings.send(x); m}
end