Class: Webpipe::Link

Inherits:
Struct
  • Object
show all
Defined in:
lib/webpipe/types.rb

Overview

A link extracted from a page.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#hrefObject

Returns the value of attribute href

Returns:

  • (Object)

    the current value of href



5
6
7
# File 'lib/webpipe/types.rb', line 5

def href
  @href
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



5
6
7
# File 'lib/webpipe/types.rb', line 5

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



6
7
8
# File 'lib/webpipe/types.rb', line 6

def self.from_hash(hash)
  new(hash["text"], hash["href"])
end