Sha256: 70bc2702b1c23df3c8b22cfc2adf6e27a7914532c15fe232da65136b40bf463a

Contents?: true

Size: 286 Bytes

Versions: 29

Compression:

Stored size: 286 Bytes

Contents

module Yaks
  class Mapper
    class HasOne < Association
      def map_resource(object, context)
        resolve_association_mapper(context.fetch(:policy))
          .new(context)
          .call(object)
      end

      def singular_name
        name.to_s
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
yaks-0.13.0 lib/yaks/mapper/has_one.rb
yaks-0.12.0 lib/yaks/mapper/has_one.rb
yaks-0.11.0 lib/yaks/mapper/has_one.rb
yaks-0.10.0 lib/yaks/mapper/has_one.rb
yaks-0.9.0 lib/yaks/mapper/has_one.rb
yaks-0.8.3 lib/yaks/mapper/has_one.rb
yaks-0.8.2 lib/yaks/mapper/has_one.rb
yaks-0.8.1 lib/yaks/mapper/has_one.rb
yaks-0.8.0 lib/yaks/mapper/has_one.rb
yaks-0.8.0.beta2 lib/yaks/mapper/has_one.rb
yaks-0.8.0.beta1 lib/yaks/mapper/has_one.rb
yaks-0.8.0.alpha lib/yaks/mapper/has_one.rb
yaks-0.7.7 lib/yaks/mapper/has_one.rb
yaks-0.7.6 lib/yaks/mapper/has_one.rb
yaks-0.7.5 lib/yaks/mapper/has_one.rb
yaks-0.7.4 lib/yaks/mapper/has_one.rb
yaks-0.7.3 lib/yaks/mapper/has_one.rb
yaks-0.7.2 lib/yaks/mapper/has_one.rb
yaks-0.7.1 lib/yaks/mapper/has_one.rb
yaks-0.7.0 lib/yaks/mapper/has_one.rb