Class: Cachai::Response
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Cachai::Response
- Defined in:
- lib/models.rb
Instance Method Summary collapse
Instance Method Details
#as_json(options = {}) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/models.rb', line 80 def as_json( = {}) { :id => id, :author_name => , # :author_email => author_email, :author_img => , :author_url => , :content => content, :timestamp => created_at.to_i, :parent_id => parent_id, :type => response_type, # :created_at => created_at, :created_ago => Timeago.since(created_at) } end |
#author_img(size = 50) ⇒ Object
96 97 98 99 |
# File 'lib/models.rb', line 96 def (size = 50) id = Digest::MD5::hexdigest(.strip.downcase) "https://www.gravatar.com/avatar/#{id}.jpg?s=#{size}" end |