Sha256: bc1ec7fd9b4661cffccb48c2e472a02a59f986094d8212eecb6587500daec47e

Contents?: true

Size: 541 Bytes

Versions: 13

Compression:

Stored size: 541 Bytes

Contents

module Onering
  class API
    class Configuration < API
      def get(key, options={})
        get("/config/#{key}").parsed_response
      end

      def set(key, value)
        if not value.is_a?(Hash) and not value.is_a?(Array)
          return save(key, value)
        end

        return nil
      end

      def save(key, data=nil, &block)
        if block_given?
          post("/config/#{key}", {}, &block)
        else
          post("/config/#{key}", {
            :body => data
          })
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onering-client-0.4.3 lib/onering/plugins/config.rb
onering-client-0.4.1 lib/onering/plugins/config.rb
onering-client-0.4.0 lib/onering/plugins/config.rb
onering-client-0.3.4 lib/onering/plugins/config.rb
onering-client-0.3.3 lib/onering/plugins/config.rb
onering-client-0.3.2 lib/onering/plugins/config.rb
onering-client-0.3.1 lib/onering/plugins/config.rb
onering-client-0.1.7 lib/onering/plugins/config.rb
onering-client-0.1.6 lib/onering/plugins/config.rb
onering-client-0.1.5 lib/onering/plugins/config.rb
onering-client-0.1.4 lib/onering/plugins/config.rb
onering-client-0.1.3 lib/onering/plugins/config.rb
onering-client-0.1.2 lib/onering/plugins/config.rb