Navigation Menu

Skip to content

Commit

Permalink
Use meaningful name
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 15, 2015
1 parent 97c346a commit a471cf0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/droonga/planner.rb
Expand Up @@ -22,12 +22,12 @@ class Planner
include Loggable
include ErrorMessages

attr_writer :write, :random, :collector_class
attr_writer :write, :collector_class

def initialize(dataset)
@dataset = dataset
@write = false
@ramdom = nil
@specified_random = nil
@collector_class = nil
end

Expand All @@ -49,16 +49,20 @@ def plan(message, params={})
end
end

def random=(value)
@specified_random = value
end

private
def write?
@write
end

def random?
unless @random.nil?
@random
else
if @specified_random.nil?
not write?
else
@specified_random
end
end

Expand Down

0 comments on commit a471cf0

Please sign in to comment.