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



142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/imgur.rb', line 142

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.



130
131
132
# File 'lib/imgur.rb', line 130

def author
  @author
end

#author_idObject

Returns the value of attribute author_id.



132
133
134
# File 'lib/imgur.rb', line 132

def author_id
  @author_id
end

#captionObject

Returns the value of attribute caption.



129
130
131
# File 'lib/imgur.rb', line 129

def caption
  @caption
end

#childrenObject

Returns the value of attribute children.



140
141
142
# File 'lib/imgur.rb', line 140

def children
  @children
end

#dateObject

Returns the value of attribute date.



137
138
139
# File 'lib/imgur.rb', line 137

def date
  @date
end

#deletedObject

Returns the value of attribute deleted.



139
140
141
# File 'lib/imgur.rb', line 139

def deleted
  @deleted
end

#downsObject

Returns the value of attribute downs.



135
136
137
# File 'lib/imgur.rb', line 135

def downs
  @downs
end

#idObject

Returns the value of attribute id.



127
128
129
# File 'lib/imgur.rb', line 127

def id
  @id
end

#image_idObject

Returns the value of attribute image_id.



128
129
130
# File 'lib/imgur.rb', line 128

def image_id
  @image_id
end

#on_albumObject

Returns the value of attribute on_album.



133
134
135
# File 'lib/imgur.rb', line 133

def on_album
  @on_album
end

#parent_idObject

Returns the value of attribute parent_id.



138
139
140
# File 'lib/imgur.rb', line 138

def parent_id
  @parent_id
end

#pointsObject

Returns the value of attribute points.



136
137
138
# File 'lib/imgur.rb', line 136

def points
  @points
end

#upsObject

Returns the value of attribute ups.



134
135
136
# File 'lib/imgur.rb', line 134

def ups
  @ups
end

Instance Method Details

#deleted?Boolean



173
174
175
# File 'lib/imgur.rb', line 173

def deleted?
  @deleted
end

#downvotesObject



165
166
167
# File 'lib/imgur.rb', line 165

def downvotes
  @downs
end

#has_parent?Boolean



169
170
171
# File 'lib/imgur.rb', line 169

def has_parent?
  @parent_id != nil
end

#on_album?Boolean



157
158
159
# File 'lib/imgur.rb', line 157

def on_album?
  @on_album
end

#upvotesObject



161
162
163
# File 'lib/imgur.rb', line 161

def upvotes
  @ups
end