Class: WrapIt::Link
- Includes:
- TextContainer
- Defined in:
- lib/wrap_it/link.rb
Overview
Link
Instance Attribute Summary
Attributes included from TextContainer
Attributes inherited from Base
Instance Method Summary collapse
Methods included from TextContainer
Methods inherited from Base
#initialize, #omit_content?, #render, #unwrap, #wrap
Methods included from Renderer
Methods included from Enums
Methods included from DerivedAttributes
Methods included from Switches
Methods included from HTMLData
included, #remove_html_data, #set_html_data
Methods included from HTMLClass
#add_html_class, #html_class, #html_class=, #html_class?, #html_class_prefix, included, #no_html_class?, #remove_html_class, sanitize
Methods included from Sections
Methods included from Callbacks
Constructor Details
This class inherits a constructor from WrapIt::Base
Instance Method Details
#href ⇒ Object
12 13 14 |
# File 'lib/wrap_it/link.rb', line 12 def href @options[:href] end |
#href=(value) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wrap_it/link.rb', line 16 def href=(value) if value.is_a?(Hash) defined?(Rails) || fail( ArgumentError, 'Hash links supported only in Rails env' ) value = @template.url_for(value) end value.is_a?(String) || fail(ArgumentError, 'Wrong link type') @options[:href] = value end |