Class: Travis::Client::Namespace
- Inherits:
-
Module
- Object
- Module
- Travis::Client::Namespace
- Includes:
- Methods
- Defined in:
- lib/travis/client/namespace.rb
Defined Under Namespace
Classes: Curry
Instance Attribute Summary collapse
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
- #included(klass) ⇒ Object
-
#initialize(session = nil) ⇒ Namespace
constructor
A new instance of Namespace.
Methods included from Methods
#access_token, #access_token=, #api_endpoint, #api_endpoint=, #artifact, #build, #explicit_api_endpoint?, #github_auth, #job, #repo, #repos, #restart, #user, #worker, #workers
Constructor Details
#initialize(session = nil) ⇒ Namespace
Returns a new instance of Namespace.
52 53 54 55 56 57 58 59 60 |
# File 'lib/travis/client/namespace.rb', line 52 def initialize(session = nil) session = Travis::Client.new(session || {}) unless session.is_a? Session @session = session Entity.subclasses.each do |subclass| name = subclass.name[/[^:]+$/] const_set(name, Curry.new(self, subclass)) end end |
Instance Attribute Details
#session ⇒ Object
Returns the value of attribute session.
50 51 52 |
# File 'lib/travis/client/namespace.rb', line 50 def session @session end |
Instance Method Details
#included(klass) ⇒ Object
62 63 64 65 |
# File 'lib/travis/client/namespace.rb', line 62 def included(klass) fix_names(klass) delegate_session(klass) end |