lib/gooddata/models/project_metadata.rb in gooddata-0.6.9 vs lib/gooddata/models/project_metadata.rb in gooddata-0.6.10
- old
+ new
@@ -1,15 +1,15 @@
# encoding: UTF-8
module GoodData
class ProjectMetadata
class << self
- def keys(opts = { :client => GoodData.connection })
+ def keys(opts = { :client => GoodData.connection, :project => GoodData.project })
ProjectMetadata[:all, opts].keys
end
- def [](key, opts = { :client => GoodData.connection })
+ def [](key, opts = { :client => GoodData.connection, :project => GoodData.project })
client = opts[:client]
fail ArgumentError, 'No :client specified' if client.nil?
project = opts[:project]
fail ArgumentError, 'No :project specified' if project.nil?
@@ -29,17 +29,17 @@
end
alias_method :get, :[]
alias_method :get_key, :[]
- def key?(key, opts = { :client => GoodData.connection })
+ def key?(key, opts = { :client => GoodData.connection, :project => GoodData.project })
ProjectMetadata[key, opts]
true
rescue RestClient::ResourceNotFound
false
end
- def []=(key, opts = { :client => GoodData.connection }, val = nil)
+ def []=(key, opts = { :client => GoodData.connection, :project => GoodData.project }, val = nil)
client = opts[:client]
fail ArgumentError, 'No :client specified' if client.nil?
project = opts[:project]
fail ArgumentError, 'No :project specified' if project.nil?