Class: VineDl::User

Inherits:
Object
  • Object
show all
Defined in:
lib/vine_dl/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_username, _password) ⇒ User

Returns a new instance of User.



8
9
10
11
# File 'lib/vine_dl/user.rb', line 8

def initialize(_username, _password)
  @username = _username
  @password = _password
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/vine_dl/user.rb', line 6

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



6
7
8
# File 'lib/vine_dl/user.rb', line 6

def username
  @username
end

Instance Method Details

#timelineObject



17
18
19
# File 'lib/vine_dl/user.rb', line 17

def timeline
  @timeline ||= client.timelines(twitter_id)
end

#twitter_idObject



21
22
23
# File 'lib/vine_dl/user.rb', line 21

def twitter_id
  @twitter_id ||= client..fetch(:twitterId)
end

#videosObject



13
14
15
# File 'lib/vine_dl/user.rb', line 13

def videos
  @videos ||= timeline.records.map { |client_video| Video.new(self, client_video) }
end