Class: App42::Recommend::RecommendedItem

Inherits:
Object
  • Object
show all
Defined in:
lib/recommend/Recommender.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recommender) ⇒ RecommendedItem

This is a constructor that takes no parameter



32
33
34
# File 'lib/recommend/Recommender.rb', line 32

def initialize(recommender)
  recommender.recommendedItemList.push(self)
end

Instance Attribute Details

#itemObject

Returns the value of attribute item.



24
25
26
# File 'lib/recommend/Recommender.rb', line 24

def item
  @item
end

#userIdObject

Returns the value of attribute userId.



24
25
26
# File 'lib/recommend/Recommender.rb', line 24

def userId
  @userId
end

#valueObject

Returns the value of attribute value.



24
25
26
# File 'lib/recommend/Recommender.rb', line 24

def value
  @value
end

Instance Method Details

#to_sObject

Returns the Recommender Response in JSON format.

Returns:

  • the response in JSON format.



42
43
44
# File 'lib/recommend/Recommender.rb', line 42

def to_s
  return "UserId : #{self.userId}" + "item : #{self.item}" + "value : #{self.value}";
end