Class: Imgur::Account

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, username = nil) ⇒ Account



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/imgur.rb', line 112

def initialize(data, username=nil)
  @id = data['id']
  @url = data['url']
  @bio = data['bio']
  @reputation = data['reputation']
  @created = Time.at data['created']
  if data['pro_expiration'].is_a? Integer
    @pro = Time.at
  end
  @username = username
end

Instance Attribute Details

#bioObject

Returns the value of attribute bio.



106
107
108
# File 'lib/imgur.rb', line 106

def bio
  @bio
end

#createdObject

Returns the value of attribute created.



108
109
110
# File 'lib/imgur.rb', line 108

def created
  @created
end

#idObject

Returns the value of attribute id.



104
105
106
# File 'lib/imgur.rb', line 104

def id
  @id
end

#pro_expirationObject

Returns the value of attribute pro_expiration.



109
110
111
# File 'lib/imgur.rb', line 109

def pro_expiration
  @pro_expiration
end

#reputationObject

Returns the value of attribute reputation.



107
108
109
# File 'lib/imgur.rb', line 107

def reputation
  @reputation
end

#urlObject

Returns the value of attribute url.



105
106
107
# File 'lib/imgur.rb', line 105

def url
  @url
end

#usernameObject

Returns the value of attribute username.



110
111
112
# File 'lib/imgur.rb', line 110

def username
  @username
end