Skip to content

Commit

Permalink
Merge b868e63 into b6d6479
Browse files Browse the repository at this point in the history
  • Loading branch information
chopraanmol1 committed Dec 26, 2018
2 parents b6d6479 + b868e63 commit cdca909
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/roo/excelx/cell/base.rb
Expand Up @@ -58,7 +58,7 @@ def type
end

def formula?
!!@formula
!!(defined?(@formula) && @formula)
end

def link?
Expand Down
2 changes: 1 addition & 1 deletion lib/roo/helpers/weak_instance_cache.rb
Expand Up @@ -10,7 +10,7 @@ module WeakInstanceCache
def instance_cache(key)
object = nil

if (ref = instance_variable_get(key)) && ref.weakref_alive?
if instance_variable_defined?(key) && (ref = instance_variable_get(key)) && ref.weakref_alive?
begin
object = ref.__getobj__
rescue => e
Expand Down
2 changes: 1 addition & 1 deletion test/excelx/cell/test_attr_reader_default.rb
Expand Up @@ -57,7 +57,7 @@ def test_cell_default_values
def assert_values(object, value_hash)
value_hash.each do |attr_name, expected_value|
value = if attr_name.to_s.include?("@")
object.instance_variable_get(attr_name)
object.instance_variable_defined?(attr_name) ? object.instance_variable_get(attr_name) : nil
else
object.public_send(attr_name)
end
Expand Down

0 comments on commit cdca909

Please sign in to comment.