lib/dbf/table.rb in dbf-4.3.0 vs lib/dbf/table.rb in dbf-4.3.1
- old
+ new
@@ -84,11 +84,11 @@
# Closes the table and memo file
#
# @return [TrueClass, FalseClass]
def close
@data.close
- @memo && @memo.close
+ @memo&.close
end
# @return [TrueClass, FalseClass]
def closed?
if @memo
@@ -253,19 +253,19 @@
safe_seek { @data.read(1).ord == 13 }
end
def find_all(options) # :nodoc:
select do |record|
- next unless record && record.match?(options)
+ next unless record&.match?(options)
yield record if block_given?
record
end
end
def find_first(options) # :nodoc:
- detect { |record| record && record.match?(options) }
+ detect { |record| record&.match?(options) }
end
def foxpro? # :nodoc:
FOXPRO_VERSIONS.key?(version)
end
@@ -276,16 +276,15 @@
Header.new(@data.read(DBASE3_HEADER_SIZE))
end
end
def memo_class # :nodoc:
- @memo_class ||= begin
- if foxpro?
- Memo::Foxpro
+ @memo_class ||= if foxpro?
+ Memo::Foxpro
else
version == '83' ? Memo::Dbase3 : Memo::Dbase4
- end
end
+
end
def memo_search_path(io) # :nodoc:
dirname = File.dirname(io)
basename = File.basename(io, '.*')