Sha256: cf755853fb76baa9b1ef760061340cb58f4df1b7b619c962a69d8353799930dc

Contents?: true

Size: 641 Bytes

Versions: 5

Compression:

Stored size: 641 Bytes

Contents

module F5
  module Icontrol
    class RAPI
      class Resource
        def initialize(args, credentials)
          @args = args
          @credentials = credentials
        end

        def method_missing(method, *args, &block)
          if @args.key? method.to_s
            return @args[method.to_s]
          end

          potential_collection = "#{method}Reference"
          if @args.key? potential_collection
            link = @args[potential_collection]["link"]
            link.gsub! /^http?s:\/\/localhost\//, ""
            return F5::Icontrol::RAPI.new(link, @credentials)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
f5-icontrol-0.3.5 lib/f5/icontrol/rapi/resource.rb
f5-icontrol-0.3.3 lib/f5/icontrol/rapi/resource.rb
f5-icontrol-0.3.2 lib/f5/icontrol/rapi/resource.rb
f5-icontrol-0.3.1 lib/f5/icontrol/rapi/resource.rb
f5-icontrol-0.3.0 lib/f5/icontrol/rapi/resource.rb