Sha256: cbf3bdee45a05d75664303d66a0c556a872051b6c2f81bc9dcf44aa1d08ccc03

Contents?: true

Size: 240 Bytes

Versions: 9

Compression:

Stored size: 240 Bytes

Contents

module Tableling

  class TypeSerializer

    def initialize type, block
      @type, @block = type, block
    end

    def match? value
      value.kind_of? @type
    end

    def serialize value
      @block.call value
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tableling-rails-0.0.26 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.25 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.24 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.23 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.22 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.21 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.20 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.19 lib/tableling-rails/type_serializer.rb
tableling-rails-0.0.18 lib/tableling-rails/type_serializer.rb