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.



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

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.



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

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.



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

def id
  @id
end

#pro_expirationObject

Returns the value of attribute pro_expiration.



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

def pro_expiration
  @pro_expiration
end

#reputationObject

Returns the value of attribute reputation.



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

def reputation
  @reputation
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end