Skip to content

Commit

Permalink
Remove Base#to_hash
Browse files Browse the repository at this point in the history
Use Base#arguments instead.
  • Loading branch information
kou committed Sep 13, 2013
1 parent 62cb4f5 commit 35d6161
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
10 changes: 0 additions & 10 deletions lib/groonga/command/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@ def to_command_format
command_line.join(" ")
end

def to_hash
converted_hash = {}
self.class.parameter_names.each do |parameter|
unless self[parameter].nil?
converted_hash[parameter] = self[parameter]
end
end
converted_hash
end

private
def construct_arguments(pair_arguments, ordered_arguments)
arguments = {}
Expand Down
25 changes: 0 additions & 25 deletions test/command/test-base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,6 @@ def test_double_quote
end
end

class CovnertToHashTest < self
class TemporaryCommand < Groonga::Command::Base
Groonga::Command.register("temporary_command", self)

class << self
def parameter_names
[
:parameter1,
:parameter2,
:parameter3,
]
end
end
end

def test_convert
select = TemporaryCommand.new("temporary_command",
:parameter1 => "value1",
:parameter2 => "value2")
assert_equal({ :parameter1 => "value1",
:parameter2 => "value2" },
select.to_hash)
end
end

sub_test_case("#[]") do
def setup
@table = "Users"
Expand Down

0 comments on commit 35d6161

Please sign in to comment.