Sha256: e4cbe7d1a5c6ede1652feb5bd69e1de49df9654fed36d06abbd3d3114bdc95de

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

require 'delegate'
require 'forwardable'

module JrubyCoercion

  class Converter < SimpleDelegator
    extend Forwardable
    def_delegator :@converter, :call

    attr_reader :converter

    ##
    # Constructor
    #
    def initialize(converter)
      @converter = converter
      super(!!@converter)
    end

    ## 
    # Public Instance Methods
    #
    def to_ary
      [ self, @converter ]        
    end

    alias_method :coerce, :call
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jruby_coercion-0.0.7-java lib/jruby_coercion/converter.rb
jruby_coercion-0.0.6-java lib/jruby_coercion/converter.rb
jruby_coercion-0.0.5-java lib/jruby_coercion/converter.rb
jruby_coercion-0.0.4-java lib/jruby_coercion/converter.rb
jruby_coercion-0.0.3-java lib/jruby_coercion/converter.rb