Class: Hancock::Goto::Configuration
- Inherits:
-
Object
- Object
- Hancock::Goto::Configuration
- Defined in:
- lib/hancock/goto/configuration.rb
Instance Attribute Summary collapse
-
#add_nofollow ⇒ Object
Returns the value of attribute add_nofollow.
-
#add_noindex ⇒ Object
Returns the value of attribute add_noindex.
-
#add_noopener ⇒ Object
Returns the value of attribute add_noopener.
-
#add_noreferrer ⇒ Object
Returns the value of attribute add_noreferrer.
-
#css_selector ⇒ Object
Returns the value of attribute css_selector.
-
#del_attrs ⇒ Object
Returns the value of attribute del_attrs.
-
#excluded_hosts ⇒ Object
Returns the value of attribute excluded_hosts.
-
#href_regex ⇒ Object
Returns the value of attribute href_regex.
-
#model_settings_support ⇒ Object
Returns the value of attribute model_settings_support.
-
#ra_comments_support ⇒ Object
Returns the value of attribute ra_comments_support.
-
#user_abilities_support ⇒ Object
Returns the value of attribute user_abilities_support.
Instance Method Summary collapse
- #default_html_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/hancock/goto/configuration.rb', line 29 def initialize @css_selector = "a[href]" @href_regex = /^(https?:)?\/\//i @excluded_hosts = [] @add_nofollow = true @add_noindex = true @add_noreferrer = true @add_noopener = true @del_attrs = true @model_settings_support = !!defined?(RailsAdminModelSettings) @user_abilities_support = !!defined?(RailsAdminUserAbilities) @ra_comments_support = !!defined?(RailsAdminComments) end |
Instance Attribute Details
#add_nofollow ⇒ Object
Returns the value of attribute add_nofollow.
19 20 21 |
# File 'lib/hancock/goto/configuration.rb', line 19 def add_nofollow @add_nofollow end |
#add_noindex ⇒ Object
Returns the value of attribute add_noindex.
20 21 22 |
# File 'lib/hancock/goto/configuration.rb', line 20 def add_noindex @add_noindex end |
#add_noopener ⇒ Object
Returns the value of attribute add_noopener.
22 23 24 |
# File 'lib/hancock/goto/configuration.rb', line 22 def add_noopener @add_noopener end |
#add_noreferrer ⇒ Object
Returns the value of attribute add_noreferrer.
21 22 23 |
# File 'lib/hancock/goto/configuration.rb', line 21 def add_noreferrer @add_noreferrer end |
#css_selector ⇒ Object
Returns the value of attribute css_selector.
15 16 17 |
# File 'lib/hancock/goto/configuration.rb', line 15 def css_selector @css_selector end |
#del_attrs ⇒ Object
Returns the value of attribute del_attrs.
23 24 25 |
# File 'lib/hancock/goto/configuration.rb', line 23 def del_attrs @del_attrs end |
#excluded_hosts ⇒ Object
Returns the value of attribute excluded_hosts.
17 18 19 |
# File 'lib/hancock/goto/configuration.rb', line 17 def excluded_hosts @excluded_hosts end |
#href_regex ⇒ Object
Returns the value of attribute href_regex.
16 17 18 |
# File 'lib/hancock/goto/configuration.rb', line 16 def href_regex @href_regex end |
#model_settings_support ⇒ Object
Returns the value of attribute model_settings_support.
25 26 27 |
# File 'lib/hancock/goto/configuration.rb', line 25 def model_settings_support @model_settings_support end |
#ra_comments_support ⇒ Object
Returns the value of attribute ra_comments_support.
27 28 29 |
# File 'lib/hancock/goto/configuration.rb', line 27 def ra_comments_support @ra_comments_support end |
#user_abilities_support ⇒ Object
Returns the value of attribute user_abilities_support.
26 27 28 |
# File 'lib/hancock/goto/configuration.rb', line 26 def user_abilities_support @user_abilities_support end |
Instance Method Details
#default_html_options ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/hancock/goto/configuration.rb', line 45 def return @default_html_options if @default_html_options @default_html_options = {target: :_blank} _rel = [] _rel << 'nofollow' if Hancock::Goto.config.add_nofollow _rel << 'noindex' if Hancock::Goto.config.add_noindex _rel << 'noreferrer' if Hancock::Goto.config.add_noreferrer _rel << 'noopener' if Hancock::Goto.config.add_noopener @default_html_options[:rel] = _rel.join(" ") @default_html_options end |