Class: Link

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

Overview

A Link model

Author:

  • Daniel Machado Fernandez

Version:

  • 1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



7
8
9
# File 'lib/model/USMF/link.rb', line 7

def href
  @href
end

#serviceObject

Returns the value of attribute service.



7
8
9
# File 'lib/model/USMF/link.rb', line 7

def service
  @service
end

#thumbnailObject

Returns the value of attribute thumbnail.



7
8
9
# File 'lib/model/USMF/link.rb', line 7

def thumbnail
  @thumbnail
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/model/USMF/link.rb', line 7

def title
  @title
end

Instance Method Details

#to_hashHash

Unify the fields into a hash

Returns:

  • (Hash)

    resultant hash



20
21
22
23
24
25
26
27
28
# File 'lib/model/USMF/link.rb', line 20

def to_hash
	res = {  
			"service" => service,
			"title" => title,
			"thumbnail" => thumbnail,
			"href" => href
		  }
	res
end

#to_sString

Returns resultant string.

Returns:

  • (String)

    resultant string



12
13
14
15
# File 'lib/model/USMF/link.rb', line 12

def to_s
	res = "\nservice: " + service.to_s + "\ntitle: " + title.to_s + "\nthumbnail: " + thumbnail.to_s + "\nhref: " + href.to_s
	res
end