Sha256: a8352ba13c28bfdc8b206831f84ccc74840c43d47831c8dc2f63f414dca1e381

Contents?: true

Size: 521 Bytes

Versions: 15

Compression:

Stored size: 521 Bytes

Contents

require 'virtus'
require 'representable/coercion'

module Roar::Representer::Feature
  # Use the +:type+ option to specify the conversion type.
  # class ImmigrantSong
  #   include Roar::Representer::JSON
  #   include Roar::Representer::Feature::Coercion
  #
  #   property :composed_at, :type => DateTime, :default => "May 12th, 2012"
  # end
  module Coercion
    def self.included(base)
      base.class_eval do
        include Virtus
        extend Representable::Coercion::ClassMethods
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
roar-0.11.19 lib/roar/representer/feature/coercion.rb
roar-0.11.18 lib/roar/representer/feature/coercion.rb
roar-0.11.17 lib/roar/representer/feature/coercion.rb
roar-0.11.16 lib/roar/representer/feature/coercion.rb
roar-0.11.15 lib/roar/representer/feature/coercion.rb
roar-0.11.14 lib/roar/representer/feature/coercion.rb
roar-0.11.13 lib/roar/representer/feature/coercion.rb
roar-0.11.12 lib/roar/representer/feature/coercion.rb
roar-0.11.11 lib/roar/representer/feature/coercion.rb
roar-0.11.10 lib/roar/representer/feature/coercion.rb
roar-0.11.9 lib/roar/representer/feature/coercion.rb
roar-0.11.8 lib/roar/representer/feature/coercion.rb
roar-0.11.7 lib/roar/representer/feature/coercion.rb
roar-0.11.6 lib/roar/representer/feature/coercion.rb
roar-0.11.5 lib/roar/representer/feature/coercion.rb