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-1.1.3 lib/spreadsheet/compatibility.rb
spreadsheet-1.1.2 lib/spreadsheet/compatibility.rb
spreadsheet-1.1.1 lib/spreadsheet/compatibility.rb
spreadsheet-1.1.0 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.9 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.8 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.7 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.6 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.5 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.4 lib/spreadsheet/compatibility.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/spreadsheet-1.0.3/lib/spreadsheet/compatibility.rb
spreadsheet-1.0.3 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.2 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.1 lib/spreadsheet/compatibility.rb
nulogy-spreadsheet-0.6.5.7.4 lib/spreadsheet/compatibility.rb
spreadsheet-1.0.0 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.9 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.8 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.7 lib/spreadsheet/compatibility.rb
spreadsheet-0.9.6 lib/spreadsheet/compatibility.rb