Sha256: 586794724b885b0704304bc7815800645de56d09a129485d413555780e94744b

Contents?: true

Size: 524 Bytes

Versions: 7

Compression:

Stored size: 524 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

7 entries across 7 versions & 1 rubygems

Version Path
roar-0.11.4 lib/roar/representer/feature/coercion.rb
roar-0.11.3 lib/roar/representer/feature/coercion.rb
roar-0.11.2 lib/roar/representer/feature/coercion.rb
roar-0.11.1 lib/roar/representer/feature/coercion.rb
roar-0.11.0 lib/roar/representer/feature/coercion.rb
roar-0.10.2 lib/roar/representer/feature/coercion.rb
roar-0.10.1 lib/roar/representer/feature/coercion.rb