class Travis::Client::Namespace::Curry

Attributes

namespace[RW]
type[RW]

Public Class Methods

new(namespace, type) click to toggle source
# File lib/travis/client/namespace.rb, line 9
def initialize(namespace, type)
  @namespace, @type = namespace, type
end

Public Instance Methods

clear_cache() click to toggle source
# File lib/travis/client/namespace.rb, line 34
def clear_cache
  session.clear_cache
end
clear_cache!() click to toggle source
# File lib/travis/client/namespace.rb, line 38
def clear_cache!
  session.clear_cache!
end
current() click to toggle source
# File lib/travis/client/namespace.rb, line 19
def current
  result = session.find_one_or_many(type)
  Array(result).each { |e| e.curry = self }
  result
end
find(id = nil)
Alias for: find_one
find_all(params = {})
Alias for: find_many
find_many(params = {}) click to toggle source
# File lib/travis/client/namespace.rb, line 25
def find_many(params = {})
  session.find_many(type, params).each do |entity|
    entity.curry = self
  end
end
Also aliased as: find_all
find_one(id = nil) click to toggle source
# File lib/travis/client/namespace.rb, line 13
def find_one(id = nil)
  result = session.find_one(type, id)
  result.curry = self
  result
end
Also aliased as: find

Private Instance Methods

session() click to toggle source
# File lib/travis/client/namespace.rb, line 44
def session
  namespace.session
end