Skip to content

Commit

Permalink
lib/matrix.rb: Document deprecated methods [#12032] [doc] [ci-skip]
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
marcandre committed Feb 6, 2018
1 parent d3a7656 commit d3513d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/matrix.rb
Expand Up @@ -1446,16 +1446,25 @@ def to_a
@rows.collect(&:dup)
end

# Deprecated.
#
# Use map(&:to_f)
def elements_to_f
warn "Matrix#elements_to_f is deprecated, use map(&:to_f)", uplevel: 1
map(&:to_f)
end

# Deprecated.
#
# Use map(&:to_i)
def elements_to_i
warn "Matrix#elements_to_i is deprecated, use map(&:to_i)", uplevel: 1
map(&:to_i)
end

# Deprecated.
#
# Use map(&:to_r)
def elements_to_r
warn "Matrix#elements_to_r is deprecated, use map(&:to_r)", uplevel: 1
map(&:to_r)
Expand Down

0 comments on commit d3513d3

Please sign in to comment.