Sha256: 74362ebc4d06e088cc37ae9f3d46f39476e21453f8db49e95368ee5a5f3ab1ef

Contents?: true

Size: 650 Bytes

Versions: 25

Compression:

Stored size: 650 Bytes

Contents

module Isomorfeus
  module Puppetmaster
    class Response
      attr_reader :request

      def initialize(response_hash = {})
        @response_hash = response_hash ? response_hash : {}
        @request = Isomorfeus::Puppetmaster::Request.new(@response_hash['request'])
      end

      def method_missing(name, *args)
        if %i[headers ok remote_address security_details status status_text text url].include?(name)
          @response_hash[name.to_s]
        elsif :ok? == name
          @response_hash['ok']
        else
          super(name, *args)
        end
      end

      def ok?
        @response_hash[:ok]
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
isomorfeus-puppetmaster-0.5.5 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.5.4 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.5.3 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.5.2 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.5.1 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.5.0 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.4.1 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.4.0 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.5 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.4 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.3 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.2 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.1 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.3.0 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.9 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.8 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.7 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.6 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.5 lib/isomorfeus/puppetmaster/response.rb
isomorfeus-puppetmaster-0.2.4 lib/isomorfeus/puppetmaster/response.rb