Class: SelectedLinks::Link
- Inherits:
-
Object
- Object
- SelectedLinks::Link
- Defined in:
- lib/selected_links/link.rb
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(*args, &block) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(*args, &block) ⇒ Link
Returns a new instance of Link.
6 7 8 9 10 11 |
# File 'lib/selected_links/link.rb', line 6 def initialize(*args, &block) @name, @options, @html_options = parse_args(block_given?, *args) @matcher = @html_options.delete(:matcher) @source = @html_options.delete(:source) @class_name = @html_options.delete(:class_name) end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
3 4 5 |
# File 'lib/selected_links/link.rb', line 3 def @html_options end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/selected_links/link.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/selected_links/link.rb', line 3 def @options end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/selected_links/link.rb', line 4 def source @source end |
Instance Method Details
#generate ⇒ Object
13 14 15 16 |
# File 'lib/selected_links/link.rb', line 13 def generate merge_classes if is_match? self end |