Class: Gratitude::Profile
- Inherits:
-
Object
- Object
- Gratitude::Profile
- Includes:
- Connection
- Defined in:
- lib/gratitude/profile.rb
Instance Attribute Summary collapse
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #amount_receiving ⇒ Object (also: #receiving)
- #bitcoin ⇒ Object
- #giving ⇒ Object (also: #amount_giving)
- #goal ⇒ Object
-
#initialize(username) ⇒ Profile
constructor
A new instance of Profile.
Methods included from Connection
Constructor Details
#initialize(username) ⇒ Profile
Returns a new instance of Profile.
8 9 10 |
# File 'lib/gratitude/profile.rb', line 8 def initialize(username) @username = username end |
Instance Attribute Details
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/gratitude/profile.rb', line 6 def username @username end |
Instance Method Details
#amount_receiving ⇒ Object Also known as: receiving
32 33 34 |
# File 'lib/gratitude/profile.rb', line 32 def amount_receiving response_body.fetch("receiving").to_f end |
#bitcoin ⇒ Object
41 42 43 |
# File 'lib/gratitude/profile.rb', line 41 def bitcoin response_body.fetch("bitcoin") { nil } end |
#giving ⇒ Object Also known as: amount_giving
27 28 29 |
# File 'lib/gratitude/profile.rb', line 27 def giving response_body.fetch("giving").to_f end |
#goal ⇒ Object
37 38 39 |
# File 'lib/gratitude/profile.rb', line 37 def goal response_body.fetch("goal").to_f if response_body["goal"] end |