Sha256: 10b37a56c8164816fd4d055a2fc19f0c7a2a74c893e7196a270238c352ce1e55

Contents?: true

Size: 438 Bytes

Versions: 2

Compression:

Stored size: 438 Bytes

Contents

module Finix

  module HypermediaRegistry

    def self.included(base) # :nodoc:
      base.extend ClassMethods
    end

    module ClassMethods

      def define_hypermedia_types(types)
        @hypermedia_types = types.map! do |t|
          t.to_s
        end.sort!

        @hypermedia_types.each do |type|
          Finix.hypermedia_registry[type] = self
        end
      end

      attr_reader :hypermedia_types
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finix-1.0.1 lib/finix/resources/hypermedia.rb
finix-1.0.0 lib/finix/resources/hypermedia.rb