Class: Duraflame::UserLookup
- Inherits:
-
Object
- Object
- Duraflame::UserLookup
- Defined in:
- lib/duraflame/user_lookup.rb
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(http_client) ⇒ UserLookup
constructor
A new instance of UserLookup.
Constructor Details
#initialize(http_client) ⇒ UserLookup
Returns a new instance of UserLookup.
3 4 5 6 |
# File 'lib/duraflame/user_lookup.rb', line 3 def initialize(http_client) @users = {} @http_client = http_client end |
Instance Method Details
#[](id) ⇒ Object
8 9 10 11 12 |
# File 'lib/duraflame/user_lookup.rb', line 8 def [](id) @users[id] ||= begin @http_client.get("/users/#{id}.json")['user']['name'] end end |