Class: ODDB::Util::Feedback

Inherits:
Model
  • Object
show all
Defined in:
lib/oddb/util/feedback.rb

Constant Summary

Constants included from OddbUri

OddbUri::YAML_URI

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

#__odba_delete__, #__odba_save__, _serializables, belongs_to, connections, connector, connectors, #data_origin, #data_origins, delegates, #delete, find_by_uid, has_many, is_coded, m10l_document, multilingual, #odba_serializables, #oid, on_delete, on_save, predicates, #save, #saved?, serializables, serialize, singular

Methods included from ODBA::Persistable

#to_yaml_properties

Methods included from Yaml

append_features, #to_yaml_properties

Methods included from OddbUri

#to_yaml, #to_yaml_map, #to_yaml_type

Instance Attribute Details

#emailObject

Returns the value of attribute email.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def email
  @email
end

#email_publicObject

Returns the value of attribute email_public.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def email_public
  @email_public
end

#item_good_experienceObject

Returns the value of attribute item_good_experience.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def item_good_experience
  @item_good_experience
end

#item_good_impressionObject

Returns the value of attribute item_good_impression.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def item_good_impression
  @item_good_impression
end

#item_helpsObject

Returns the value of attribute item_helps.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def item_helps
  @item_helps
end

Returns the value of attribute item_recommended.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def item_recommended
  @item_recommended
end

#messageObject

Returns the value of attribute message.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def message
  @message
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def name
  @name
end

#timeObject

Returns the value of attribute time.



10
11
12
# File 'lib/oddb/util/feedback.rb', line 10

def time
  @time
end

Class Method Details

.newest(count = 5) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/oddb/util/feedback.rb', line 12

def self.newest(count=5)
  sorted = all.sort_by { |instance| -instance.time.to_f }
  case count
  when Integer
    sorted[0,count]
  else
    sorted
  end
end