Sha256: aadd81d23fd0d3a1c8a1d0ad5a3540cf3113f3b85f2c48e06e3b968e007aeacc

Contents?: true

Size: 538 Bytes

Versions: 14

Compression:

Stored size: 538 Bytes

Contents

module Almodovar
  class ResourcePresenter
    module Metadata

      def inherited(base)
        base.metadata[:name] = base.name.demodulize.titleize
      end

      def desc(description)
        metadata[:desc] = description
      end

      def link(name, options)
        metadata[:links][name] = options
      end

      def attribute(name, options)
        metadata[:attributes][name] = options
      end

      def metadata
        @metadata ||= Hash.new {|h,a| h[a] = ActiveSupport::OrderedHash.new}
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
almodovar-server-0.2.0 lib/almodovar-server/resource_presenter/metadata.rb
almodovar-server-0.1.2 lib/almodovar-server/resource_presenter/metadata.rb
almodovar-server-0.1.1 lib/almodovar-server/resource_presenter/metadata.rb
almodovar-server-0.1.0 lib/almodovar-server/resource_presenter/metadata.rb
almodovar-0.9.8 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.7 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.6 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.5 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.4 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.2 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.3 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.1 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.9.0 lib/almodovar/resource_presenter/metadata.rb
almodovar-0.8.0 lib/almodovar/resource_presenter/metadata.rb