Sha256: 77f3abe25bf0c430e9e636474c5ea75e02dc59dc46d3acb85a15d3f9921309cb

Contents?: true

Size: 566 Bytes

Versions: 88

Compression:

Stored size: 566 Bytes

Contents

module Spreadsheet
  module Compatibility
    ##
    # One of the most incisive changes in terms of meta-programming in Ruby 1.9
    # is the switch from representing instance-variable names as Strings to
    # presenting them as Symbols. ivar_name provides compatibility.
    if RUBY_VERSION >= '1.9'
      def ivar_name symbol
        :"@#{symbol}"
      end
      def method_name symbol
        symbol.to_sym
      end
    else
      def ivar_name symbol
        "@#{symbol}"
      end
      def method_name symbol
        symbol.to_s
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 7 rubygems

Version Path
spreadsheet-0.9.5 lib/spreadsheet/compatibility.rb
keeguon-spreadsheet-0.9.3 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.4 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.3 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.2 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.1 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.0 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.9 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.8 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.7 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.6 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.5 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.4 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.3 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.2 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.1 lib/spreadsheet/compatibility.rb
spreadsheet-0.8.0 lib/spreadsheet/compatibility.rb
spreadsheet-0.7.9 lib/spreadsheet/compatibility.rb
spreadsheet-0.7.8 lib/spreadsheet/compatibility.rb
spreadsheet-0.7.7 lib/spreadsheet/compatibility.rb