lib/travis/client/session.rb in travis-1.4.0 vs lib/travis/client/session.rb in travis-1.5.0
- old
+ new
@@ -168,10 +168,14 @@
def instrument(&block)
instruments << block
end
+ def private_channels?
+ access_token and user.channels != ['common']
+ end
+
private
def instrumented(name, *args)
name = [name, *args.map(&:inspect)].join(" ") if args.any?
result = nil
@@ -180,9 +184,10 @@
lift.call
result
end
def create_entity(type, data)
+ data = { "id" => data } if Integer === data or String === data
id = type.cast_id(data.fetch('id'))
entity = cached(type, :id, id) { type.new(self, id) }
entity.update_attributes(data)
entity
end