Class: SelectedLinks::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/selected_links/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_optionsObject (readonly)

Returns the value of attribute html_options.



3
4
5
# File 'lib/selected_links/link.rb', line 3

def html_options
  @html_options
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/selected_links/link.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/selected_links/link.rb', line 3

def options
  @options
end

#sourceObject

Returns the value of attribute source.



4
5
6
# File 'lib/selected_links/link.rb', line 4

def source
  @source
end

Instance Method Details

#generateObject



13
14
15
16
# File 'lib/selected_links/link.rb', line 13

def generate
  merge_classes if is_match?
  self
end