Class: FreeScrape::ItemLink

Inherits:
Object
  • Object
show all
Defined in:
lib/free_scrape/item_link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, url) ⇒ ItemLink

Creates a new ItemLink with the specified title and url.



13
14
15
16
# File 'lib/free_scrape/item_link.rb', line 13

def initialize(title,url)
  @title = title
  @url = url
end

Instance Attribute Details

#titleObject (readonly)

Title of the item



5
6
7
# File 'lib/free_scrape/item_link.rb', line 5

def title
  @title
end

#urlObject (readonly)

URL of the item



8
9
10
# File 'lib/free_scrape/item_link.rb', line 8

def url
  @url
end

Instance Method Details

#to_sObject

Returns the title of the item-link in String form.



21
22
23
# File 'lib/free_scrape/item_link.rb', line 21

def to_s
  @title.to_s
end