Class: Imgur::Comment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Comment

Returns a new instance of Comment.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/imgur.rb', line 128

def initialize(data)
  @id = data['id']
  @image_id = data['image_id']
  @caption = data['caption']
  @author = data['author']
  @author_id = data['author_id']
  @on_album = data['on_album']
  @ups = data['ups']
  @downs = data['downs']
  @points = data['points']
  @date = Time.at data['datetime']
  @parent_id = data['parent_id']
  @deleted = deleted
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



125
126
127
# File 'lib/imgur.rb', line 125

def author
  @author
end

#author_idObject

Returns the value of attribute author_id.



125
126
127
# File 'lib/imgur.rb', line 125

def author_id
  @author_id
end

#captionObject

Returns the value of attribute caption.



125
126
127
# File 'lib/imgur.rb', line 125

def caption
  @caption
end

#childrenObject

Returns the value of attribute children.



125
126
127
# File 'lib/imgur.rb', line 125

def children
  @children
end

#dateObject

Returns the value of attribute date.



125
126
127
# File 'lib/imgur.rb', line 125

def date
  @date
end

#deletedObject

Returns the value of attribute deleted.



125
126
127
# File 'lib/imgur.rb', line 125

def deleted
  @deleted
end

#downsObject

Returns the value of attribute downs.



125
126
127
# File 'lib/imgur.rb', line 125

def downs
  @downs
end

#idObject

Returns the value of attribute id.



125
126
127
# File 'lib/imgur.rb', line 125

def id
  @id
end

#image_idObject

Returns the value of attribute image_id.



125
126
127
# File 'lib/imgur.rb', line 125

def image_id
  @image_id
end

#on_albumObject

Returns the value of attribute on_album.



125
126
127
# File 'lib/imgur.rb', line 125

def on_album
  @on_album
end

#parent_idObject

Returns the value of attribute parent_id.



125
126
127
# File 'lib/imgur.rb', line 125

def parent_id
  @parent_id
end

#pointsObject

Returns the value of attribute points.



125
126
127
# File 'lib/imgur.rb', line 125

def points
  @points
end

#upsObject

Returns the value of attribute ups.



125
126
127
# File 'lib/imgur.rb', line 125

def ups
  @ups
end

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/imgur.rb', line 159

def deleted?
  @deleted
end

#downvotesObject



151
152
153
# File 'lib/imgur.rb', line 151

def downvotes
  @downs
end

#has_parent?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/imgur.rb', line 155

def has_parent?
  @parent_id != nil
end

#on_album?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/imgur.rb', line 143

def on_album?
  @on_album
end

#upvotesObject



147
148
149
# File 'lib/imgur.rb', line 147

def upvotes
  @ups
end