Skip to content

Commit

Permalink
RUBY-1240 Fix warning message for forwarding to private methods
Browse files Browse the repository at this point in the history
  • Loading branch information
estolfo committed Sep 4, 2017
1 parent dc62d12 commit 53dca7d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/mongo/collection/view/aggregation.rb
Expand Up @@ -34,7 +34,7 @@ class Aggregation
attr_reader :pipeline

# Delegate necessary operations to the view.
def_delegators :view, :collection, :read, :cluster, :server_selector
def_delegators :view, :collection, :read, :cluster

# Delegate necessary operations to the collection.
def_delegators :collection, :database
Expand Down Expand Up @@ -90,6 +90,10 @@ def explain

private

def server_selector
@view.send(:server_selector)
end

def aggregate_spec
Builder::Aggregation.new(pipeline, view, options).specification
end
Expand Down
6 changes: 5 additions & 1 deletion lib/mongo/collection/view/map_reduce.rb
Expand Up @@ -47,7 +47,7 @@ class MapReduce
attr_reader :reduce

# Delegate necessary operations to the view.
def_delegators :view, :collection, :read, :cluster, :server_selector
def_delegators :view, :collection, :read, :cluster

# Delegate necessary operations to the collection.
def_delegators :collection, :database
Expand Down Expand Up @@ -182,6 +182,10 @@ def verbose(value = nil)

private

def server_selector
@view.send(:server_selector)
end

def inline?
out.nil? || out == { inline: 1 } || out == { INLINE => 1 }
end
Expand Down
6 changes: 5 additions & 1 deletion lib/mongo/cursor.rb
Expand Up @@ -35,7 +35,7 @@ class Cursor
include Enumerable
include Retryable

def_delegators :@view, :collection, :limit
def_delegators :@view, :collection
def_delegators :collection, :client, :database
def_delegators :@server, :cluster

Expand Down Expand Up @@ -241,6 +241,10 @@ def use_limit?
limited? && batch_size >= @remaining
end

def limit
@view.send(:limit)
end

def register
cluster.register_cursor(@cursor_id)
end
Expand Down

0 comments on commit 53dca7d

Please sign in to comment.