Sha256: 237086cfa0a0cc6021ae40cd4f68dfb21bcc7a14206acc12697055d4ebc3649f

Contents?: true

Size: 253 Bytes

Versions: 1

Compression:

Stored size: 253 Bytes

Contents

require 'alba/association'

module Alba
  # Representing one association
  class One < Association
    def to_hash(target)
      object = target.public_send(@name)
      @resource ||= resource_class
      @resource.new(object).to_hash
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alba-0.9.0 lib/alba/one.rb