Class: Travis::Client::Namespace

Inherits:
Module
  • Object
show all
Includes:
Methods
Defined in:
lib/travis/client/namespace.rb

Defined Under Namespace

Classes: Curry

Instance Attribute Summary collapse

Instance Method Summary collapse

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


44
45
46
47
48
49
50
51
52
# File 'lib/travis/client/namespace.rb', line 44

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

#sessionObject

Returns the value of attribute session


42
43
44
# File 'lib/travis/client/namespace.rb', line 42

def session
  @session
end

Instance Method Details

#included(klass) ⇒ Object


54
55
56
57
# File 'lib/travis/client/namespace.rb', line 54

def included(klass)
  fix_names(klass)
  delegate_session(klass)
end