Class: Polites::Span::Link

Inherits:
Polites::Span show all
Defined in:
lib/polites/span/link.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children

Instance Method Summary collapse

Methods inherited from Polites::Span

build

Methods inherited from Node

#text

Constructor Details

#initialize(children = [], url:, title: nil) ⇒ Link

Returns a new instance of Link.



9
10
11
12
13
# File 'lib/polites/span/link.rb', line 9

def initialize(children = [], url:, title: nil)
  super(children)
  @url = url
  @title = title
end

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/polites/span/link.rb', line 7

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/polites/span/link.rb', line 7

def url
  @url
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/polites/span/link.rb', line 15

def eql?(other)
  super &&
    url == other.url &&
    title == other.title
end