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=, #account, #accounts, #api_endpoint, #api_endpoint=, #artifact, #broadcasts, #build, #cancel, #explicit_api_endpoint?, #github_auth, #hooks, #job, #lint, #listen, #repo, #repos, #restart, #user

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

#sessionObject

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