Skip to content

Commit

Permalink
Removes link attr_reader from Cells (roo-rb#457)
Browse files Browse the repository at this point in the history
* Removes link attr_reader from Cells

* Adds deprecation method for link

* Deprecated methods should still return a value
  • Loading branch information
tgturner authored and aravindm committed Jun 18, 2019
1 parent 29992c9 commit 49af97c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
11 changes: 9 additions & 2 deletions lib/roo/excelx/cell/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ def to_s
formatted_value
end

# DEPRECATED: Please use link instead.
# DEPRECATED: Please use link? instead.
def hyperlink
warn '[DEPRECATION] `hyperlink` is deprecated. Please use `link` instead.'
warn '[DEPRECATION] `hyperlink` is deprecated. Please use `link?` instead.'
link?
end

# DEPRECATED: Please use link? instead.
def link
warn '[DEPRECATION] `link` is deprecated. Please use `link?` instead.'
link?
end

# DEPRECATED: Please use cell_value instead.
Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/boolean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Roo
class Excelx
class Cell
class Boolean < Cell::Base
attr_reader :value, :formula, :format, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_value, :coordinate

attr_reader_with_default default_type: :boolean, cell_type: :boolean

Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Roo
class Excelx
class Cell
class Date < Roo::Excelx::Cell::DateTime
attr_reader :value, :formula, :format, :cell_type, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_type, :cell_value, :coordinate

attr_reader_with_default default_type: :date

Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/datetime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Cell
class DateTime < Cell::Base
SECONDS_IN_DAY = 60 * 60 * 24

attr_reader :value, :formula, :format, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_value, :coordinate

attr_reader_with_default default_type: :datetime

Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/empty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Roo
class Excelx
class Cell
class Empty < Cell::Base
attr_reader :value, :formula, :format, :cell_type, :cell_value, :hyperlink, :coordinate
attr_reader :value, :formula, :format, :cell_type, :cell_value, :coordinate

attr_reader_with_default default_type: nil, style: nil

Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Roo
class Excelx
class Cell
class Number < Cell::Base
attr_reader :value, :formula, :format, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_value, :coordinate

# FIXME: change default_type to number. This will break brittle tests.
attr_reader_with_default default_type: :float
Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Roo
class Excelx
class Cell
class String < Cell::Base
attr_reader :value, :formula, :format, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_value, :coordinate

attr_reader_with_default default_type: :string, cell_type: :string

Expand Down
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Roo
class Excelx
class Cell
class Time < Roo::Excelx::Cell::DateTime
attr_reader :value, :formula, :format, :cell_value, :link, :coordinate
attr_reader :value, :formula, :format, :cell_value, :coordinate

attr_reader_with_default default_type: :time

Expand Down

0 comments on commit 49af97c

Please sign in to comment.