Class: VimeoRuby::User
- Defined in:
- lib/vimeo_ruby/user.rb,
lib/vimeo_ruby/user/uploaded_video_collection.rb
Defined Under Namespace
Classes: UploadedVideoCollection
Instance Attribute Summary collapse
-
#available_for_hire ⇒ Object
readonly
Returns the value of attribute available_for_hire.
-
#bio ⇒ Object
readonly
Returns the value of attribute bio.
-
#can_work_remotely ⇒ Object
readonly
Returns the value of attribute can_work_remotely.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#profile_link ⇒ Object
readonly
Returns the value of attribute profile_link.
-
#video_collection ⇒ Object
readonly
Returns the value of attribute video_collection.
Attributes inherited from Base
#access_token, #additional_info, #vimeo_id
Class Method Summary collapse
Instance Method Summary collapse
- #available_for_hire? ⇒ Boolean
- #base_uri ⇒ Object
- #can_work_remotely? ⇒ Boolean
-
#initialize(access_token: nil, attrs: {}) ⇒ User
constructor
A new instance of User.
- #uploaded_videos(query_params: {}) ⇒ Object
Methods inherited from Base
base_uri, client_identifier, client_secret, get
Constructor Details
#initialize(access_token: nil, attrs: {}) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/vimeo_ruby/user.rb', line 5 def initialize(access_token: nil, attrs: {}) @available_for_hire = attrs.delete("available_for_hire") @bio = attrs.delete("bio") @can_work_remotely = attrs.delete("can_work_remotely") @location = attrs.delete("location") @name = attrs.delete("name") @profile_link = attrs.delete("link") @video_collection = nil vimeo_uri_with_id = attrs.delete("uri") super(access_token: access_token, vimeo_id: vimeo_uri_with_id, remaining_attrs: attrs) end |
Instance Attribute Details
#available_for_hire ⇒ Object (readonly)
Returns the value of attribute available_for_hire.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def available_for_hire @available_for_hire end |
#bio ⇒ Object (readonly)
Returns the value of attribute bio.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def bio @bio end |
#can_work_remotely ⇒ Object (readonly)
Returns the value of attribute can_work_remotely.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def can_work_remotely @can_work_remotely end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def name @name end |
#profile_link ⇒ Object (readonly)
Returns the value of attribute profile_link.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def profile_link @profile_link end |
#video_collection ⇒ Object (readonly)
Returns the value of attribute video_collection.
3 4 5 |
# File 'lib/vimeo_ruby/user.rb', line 3 def video_collection @video_collection end |
Class Method Details
.get_user(access_token: nil) ⇒ Object
18 19 20 21 |
# File 'lib/vimeo_ruby/user.rb', line 18 def get_user(access_token: nil) user_info = get("#{base_uri}/me", access_token: access_token) new(access_token: access_token, attrs: user_info) end |
Instance Method Details
#available_for_hire? ⇒ Boolean
36 37 38 |
# File 'lib/vimeo_ruby/user.rb', line 36 def available_for_hire? @available_for_hire end |
#base_uri ⇒ Object
24 25 26 |
# File 'lib/vimeo_ruby/user.rb', line 24 def base_uri self.class.base_uri end |
#can_work_remotely? ⇒ Boolean
40 41 42 |
# File 'lib/vimeo_ruby/user.rb', line 40 def can_work_remotely? @can_work_remotely end |
#uploaded_videos(query_params: {}) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/vimeo_ruby/user.rb', line 28 def uploaded_videos(query_params: {}) if @video_collection.nil? || !query_params.empty? @video_collection = retrieve_video_collection(query_params) else @video_collection end end |