Class: Rumember::Account

Inherits:
Object
  • Object
show all
Includes:
Dispatcher
Defined in:
lib/rumember/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Dispatcher

#dispatch, #lists, #locations, #transaction_dispatch

Constructor Details

#initialize(interface, auth_token) ⇒ Account

Returns a new instance of Account.



7
8
9
10
# File 'lib/rumember/account.rb', line 7

def initialize(interface, auth_token)
  @interface = interface
  @auth_token = auth_token
end

Instance Attribute Details

#auth_tokenObject (readonly)

Returns the value of attribute auth_token.



5
6
7
# File 'lib/rumember/account.rb', line 5

def auth_token
  @auth_token
end

Instance Method Details

#inspectObject



36
37
38
# File 'lib/rumember/account.rb', line 36

def inspect
  "#<#{self.class.inspect}: #{username}>"
end

#new_timelineObject



20
21
22
# File 'lib/rumember/account.rb', line 20

def new_timeline
  Timeline.new(self)
end

#paramsObject



16
17
18
# File 'lib/rumember/account.rb', line 16

def params
  {'auth_token' => auth_token}
end

#parentObject



12
13
14
# File 'lib/rumember/account.rb', line 12

def parent
  @interface
end

#smart_add(name) ⇒ Object



28
29
30
# File 'lib/rumember/account.rb', line 28

def smart_add(name)
  timeline.smart_add(name)
end

#timelineObject



24
25
26
# File 'lib/rumember/account.rb', line 24

def timeline
  @timeline ||= new_timeline
end

#usernameObject



32
33
34
# File 'lib/rumember/account.rb', line 32

def username
  @username ||= dispatch('auth.checkToken')['auth']['user']['username']
end