Class: ToUser

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

Overview

Models the ToUser relation

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/to_user.rb', line 7

def href
  @href
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#serviceObject

Returns the value of attribute service.



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

def service
  @service
end

#thumbnailObject

Returns the value of attribute thumbnail.



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

def thumbnail
  @thumbnail
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/model/USMF/to_user.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
29
30
# File 'lib/model/USMF/to_user.rb', line 20

def to_hash
	res = {
			"name" => name,
			"id" => id,
			"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/to_user.rb', line 12

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