mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/matrix.rb: Deprecate elements_to_{f/i/r}
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e0cfb13c32
commit
3f64c83eb1
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Apr 12 03:45:25 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/matrix.rb: Deprecate elements_to_{f/i/r}
|
||||
|
||||
Mon Apr 12 03:30:29 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/matrix.rb: Handle coercion errors by raising TypeErrors
|
||||
|
|
|
@ -1009,15 +1009,18 @@ class Matrix
|
|||
end
|
||||
|
||||
def elements_to_f
|
||||
collect{|e| e.to_f}
|
||||
warn "#{caller(1)[0]}: warning: Matrix#elements_to_f is deprecated"
|
||||
map(&:to_f)
|
||||
end
|
||||
|
||||
def elements_to_i
|
||||
collect{|e| e.to_i}
|
||||
warn "#{caller(1)[0]}: warning: Matrix#elements_to_i is deprecated"
|
||||
map(&:to_i)
|
||||
end
|
||||
|
||||
def elements_to_r
|
||||
collect{|e| e.to_r}
|
||||
warn "#{caller(1)[0]}: warning: Matrix#elements_to_r is deprecated"
|
||||
map(&:to_r)
|
||||
end
|
||||
|
||||
#--
|
||||
|
|
Loading…
Reference in a new issue