Class: Butterfly::Like
- Inherits:
-
Object
- Object
- Butterfly::Like
- Defined in:
- lib/butterfly/like.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#liked_at ⇒ Object
Returns the value of attribute liked_at.
-
#photo_url ⇒ Object
Returns the value of attribute photo_url.
-
#service ⇒ Object
Returns the value of attribute service.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Like
constructor
A new instance of Like.
Constructor Details
#initialize(attributes = {}) ⇒ Like
Returns a new instance of Like.
16 17 18 19 20 |
# File 'lib/butterfly/like.rb', line 16 def initialize(attributes = {}) attributes.each_pair do |key, value| self.send("#{key}=", value) end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def id @id end |
#liked_at ⇒ Object
Returns the value of attribute liked_at.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def liked_at @liked_at end |
#photo_url ⇒ Object
Returns the value of attribute photo_url.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def photo_url @photo_url end |
#service ⇒ Object
Returns the value of attribute service.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def service @service end |
#tags ⇒ Object
Returns the value of attribute tags.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def url @url end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/butterfly/like.rb', line 4 def user @user end |
Instance Method Details
#as_json(options = {}) ⇒ Object
22 23 24 |
# File 'lib/butterfly/like.rb', line 22 def as_json( = {}) instance_values.merge("user" => user.as_json) end |