Skip to content

Commit

Permalink
clean no need code
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Oct 2, 2014
1 parent 84f8371 commit 47c2d67
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 34 deletions.
2 changes: 1 addition & 1 deletion bin/attr_accessible2strong_params
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby

require 'attr_accessible2strong_params'
puts AttrAccessible2StrongParams.hi(ARGV[0])
puts AttrAccessible2StrongParams.convert
8 changes: 4 additions & 4 deletions lib/attr_accessible2strong_params.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class AttrAccessible2StrongParams
def self.hi(language)
translator = Translator.new(language)
translator.hi
def self.convert
t = Converter.new
t.convert
end
end

require 'attr_accessible2strong_params/translator'
require 'attr_accessible2strong_params/converter'
require 'attr_accessible2strong_params/version'
5 changes: 5 additions & 0 deletions lib/attr_accessible2strong_params/converter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AttrAccessible2StrongParams::Converter
def convert
"hello world"
end
end
16 changes: 0 additions & 16 deletions lib/attr_accessible2strong_params/translator.rb

This file was deleted.

14 changes: 1 addition & 13 deletions test/test_attr_accessible2strong_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@

class AttrAccessible2StrongParamsTest < Test::Unit::TestCase
def test_english_hello
assert_equal "hello world", AttrAccessible2StrongParams.hi("english")
end

def test_any_hello
assert_equal "hello world", AttrAccessible2StrongParams.hi("ruby")
end

def test_spanish_hello
assert_equal "hola mundo", AttrAccessible2StrongParams.hi("spanish")
end

def test_korean_hello
assert_equal "anyoung ha se yo", AttrAccessible2StrongParams.hi("korean")
assert_equal "hello world", AttrAccessible2StrongParams.convert
end
end

0 comments on commit 47c2d67

Please sign in to comment.