Sha256: 24184f566a43f8685ee028e36a9ac726b5e312720c85a10712332fdb31b34ab6

Contents?: true

Size: 726 Bytes

Versions: 2

Compression:

Stored size: 726 Bytes

Contents

module Pakyow
  class App
    class << self
      RESOURCE_ACTIONS[:presenter] = Proc.new { |app, set_name, _, _|
        app.bindings { scope(set_name) { restful(set_name) } }
      }

      def bindings(set_name = :main, &block)
        if set_name && block
          bindings[set_name] = block
        else
          @bindings ||= {}
        end
      end

      def processor(*args, &block)
        args.each {|format|
          processors[format] = block
        }
      end

      def processors
        @processors ||= {}
      end
    end

    # Convenience method for defining bindings on an app instance.
    #
    def bindings(set_name = :main, &block)
      self.class.bindings(set_name, &block)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pakyow-presenter-0.11.1 pakyow-presenter/lib/pakyow/presenter/ext/app.rb
pakyow-presenter-0.11.0 pakyow-presenter/lib/pakyow/presenter/ext/app.rb