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

Returns a new instance of Account.



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/imgur.rb', line 107

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.



101
102
103
# File 'lib/imgur.rb', line 101

def bio
  @bio
end

#createdObject

Returns the value of attribute created.



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

def created
  @created
end

#idObject

Returns the value of attribute id.



99
100
101
# File 'lib/imgur.rb', line 99

def id
  @id
end

#pro_expirationObject

Returns the value of attribute pro_expiration.



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

def pro_expiration
  @pro_expiration
end

#reputationObject

Returns the value of attribute reputation.



102
103
104
# File 'lib/imgur.rb', line 102

def reputation
  @reputation
end

#urlObject

Returns the value of attribute url.



100
101
102
# File 'lib/imgur.rb', line 100

def url
  @url
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end