Class: Imgur::Account
- Inherits:
-
Object
- Object
- Imgur::Account
- Defined in:
- lib/imgur.rb
Instance Attribute Summary collapse
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#created ⇒ Object
Returns the value of attribute created.
-
#id ⇒ Object
Returns the value of attribute id.
-
#pro_expiration ⇒ Object
Returns the value of attribute pro_expiration.
-
#reputation ⇒ Object
Returns the value of attribute reputation.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(data, username = nil) ⇒ Account
constructor
A new instance of Account.
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
#bio ⇒ Object
Returns the value of attribute bio.
108 109 110 |
# File 'lib/imgur.rb', line 108 def bio @bio end |
#created ⇒ Object
Returns the value of attribute created.
108 109 110 |
# File 'lib/imgur.rb', line 108 def created @created end |
#id ⇒ Object
Returns the value of attribute id.
108 109 110 |
# File 'lib/imgur.rb', line 108 def id @id end |
#pro_expiration ⇒ Object
Returns the value of attribute pro_expiration.
108 109 110 |
# File 'lib/imgur.rb', line 108 def pro_expiration @pro_expiration end |
#reputation ⇒ Object
Returns the value of attribute reputation.
108 109 110 |
# File 'lib/imgur.rb', line 108 def reputation @reputation end |
#url ⇒ Object
Returns the value of attribute url.
108 109 110 |
# File 'lib/imgur.rb', line 108 def url @url end |
#username ⇒ Object
Returns the value of attribute username.
108 109 110 |
# File 'lib/imgur.rb', line 108 def username @username end |