Class: Butterfly::Like

Inherits:
Object
  • Object
show all
Defined in:
lib/butterfly/like.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute created_at.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def description
  @description
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def id
  @id
end

#liked_atObject

Returns the value of attribute liked_at.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def liked_at
  @liked_at
end

#photo_urlObject

Returns the value of attribute photo_url.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def photo_url
  @photo_url
end

#serviceObject

Returns the value of attribute service.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def service
  @service
end

#tagsObject

Returns the value of attribute tags.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def tags
  @tags
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def title
  @title
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def type
  @type
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/butterfly/like.rb', line 4

def url
  @url
end

#userObject

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(options = {})
  instance_values.merge("user" => user.as_json)
end