Sha256: 8d870d29dc46e301ade75d99fd23c5cfcd246b466f2b8911ebc6c76e0337360a

Contents?: true

Size: 685 Bytes

Versions: 24

Compression:

Stored size: 685 Bytes

Contents

module JSONAPIonify::Structure
  module Objects
    class Relationship < Base
      define_order *%i{data meta links}

      # A "relationship object" MUST contain at least one of the following:
      must_contain_one_of! :links, # A links object.
                           :data, # Resource linkage.
                           :meta # A meta object that contains non-standard meta-information about the relationship.

      implements :links, as: Maps::Links
      implements :meta, as: Meta

      collects_or_implements(
        :data,
        collects:   Collections::ResourceIdentifiers,
        implements: ResourceIdentifier,
        allow_nil:  true
      )
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
jsonapionify-0.10.0 lib/jsonapionify/structure/objects/relationship.rb
jsonapionify-0.9.3 lib/jsonapionify/structure/objects/relationship.rb
jsonapionify-0.9.2 lib/jsonapionify/structure/objects/relationship.rb
jsonapionify-0.9.1 lib/jsonapionify/structure/objects/relationship.rb