Sha256: 87ea046693947828e404056b72922ff0d39a779f0fbeb348ef7c0482223bc17f

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

module Hope
  module Server
    module Resources
      module Source

        def self.registered app

          app.get "/sources" do
            respond_with Hope::Source.sources.values.map(&:serializable_hash)
          end

          app.post "/sources" do
            source_type = body["type"]
            source_class = Hope::Source.const_get(source_type)
            src = source_class.new(body["name"], body["opts"])
          end
          
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hope-0.1.0-java lib/hope/server/resources/source.rb