Sha256: 86e7d4010495cde27d3e099ec9eb48efe3446280f877a618c2940cca687248be

Contents?: true

Size: 236 Bytes

Versions: 6

Compression:

Stored size: 236 Bytes

Contents

module Tableling

  class Serializer

    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

6 entries across 6 versions & 1 rubygems

Version Path
tableling-rails-0.0.17 lib/tableling-rails/serializer.rb
tableling-rails-0.0.16 lib/tableling-rails/serializer.rb
tableling-rails-0.0.15 lib/tableling-rails/serializer.rb
tableling-rails-0.0.14 lib/tableling-rails/serializer.rb
tableling-rails-0.0.13 lib/tableling-rails/serializer.rb
tableling-rails-0.0.12 lib/tableling-rails/serializer.rb