Class: Yt::Models::Resource
Direct Known Subclasses
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
- #kind ⇒ Object
- #username ⇒ Object
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ Resource
Returns a new instance of Resource.
17 18 19 20 21 22 23 |
# File 'lib/yt/models/resource.rb', line 17 def initialize( = {}) @url = URL.new([:url]) if [:url] @id = [:id] || (@url.id if @url) @auth = [:auth] @snippet = Snippet.new(data: [:snippet]) if [:snippet] @status = Status.new(data: [:status]) if [:status] end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
7 8 9 |
# File 'lib/yt/models/resource.rb', line 7 def auth @auth end |
Instance Method Details
#kind ⇒ Object
25 26 27 |
# File 'lib/yt/models/resource.rb', line 25 def kind @url ? @url.kind.to_s : self.class.to_s.demodulize.underscore end |
#username ⇒ Object
29 30 31 |
# File 'lib/yt/models/resource.rb', line 29 def username @url.username if @url end |