Skip to content
Browse files

add Array extend

  • Loading branch information...
1 parent 154b6fd commit 7d19ca309eb9abcbf93b6a6de7e75ceb06675935 @ZhangHanDong committed
Showing with 25 additions and 1 deletion.
  1. +1 −0 lib/ruby_extendsions.rb
  2. +23 −0 lib/ruby_extendsions/array_extendsions.rb
  3. +1 −1 ruby_extendsions.gemspec
View
1 lib/ruby_extendsions.rb
@@ -1,2 +1,3 @@
require 'ruby_extendsions/hash_extendsions'
+require 'ruby_extendsions/array_extendsions'
View
23 lib/ruby_extendsions/array_extendsions.rb
@@ -0,0 +1,23 @@
+module RubyExtendsions
+ module ArrayExtendsions
+ def self.included(base)
+ base.send :include, InstanceMethods
+ base.send :extend, ClassMethods
+ end
+
+ module InstanceMethods
+ def fill_nil(val)
+ self.inject([]){|s,a| s << a.to_s}
+ end
+ end#InstanceMethods
+
+ module ClassMethods
+ #TODO
+ end#ClassMethods
+
+ end #HashExtendsions
+end #RubyExtendsions
+
+class Array
+ include RubyExtendsions::ArrayExtendsions
+end
View
2 ruby_extendsions.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = "ruby_extendsions"
- s.version = "0.1"
+ s.version = "0.1.2"
s.platform = Gem::Platform::RUBY
s.authors = ["blackanger"]
s.email = ["blackanger.z@gmail.com"]

0 comments on commit 7d19ca3

Please sign in to comment.
Something went wrong with that request. Please try again.