Skip to content

Commit

Permalink
Added Rewrite::Policy class
Browse files Browse the repository at this point in the history
  • Loading branch information
bitflingr committed Jan 11, 2015
1 parent 6a7f045 commit 83a2f68
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/netscaler/rewrite.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'netscaler/rewrite/action'
require 'netscaler/rewrite/policy'

module Netscaler
class Rewrite
Expand All @@ -11,5 +12,9 @@ def action
Action.new @netscaler
end

def policy
Policy.new @netscaler
end

end
end
25 changes: 25 additions & 0 deletions lib/netscaler/rewrite/policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'netscaler/netscaler_service'

module Netscaler
class Rewrite
class Policy < NetscalerService

def initialize(netscaler)
@netscaler=netscaler
end

def show(payload={})
if payload[:name] != nil then
validate_payload(payload, [:name])
return @netscaler.adapter.get("config/rewritepolicy/#{payload[:name]}")
elsif payload == {} then
return @netscaler.adapter.get('config/rewritepolicy/')
else
raise ArgumentError, 'payload supplied must have been missing :name'
end
end

end
end
end

0 comments on commit 83a2f68

Please sign in to comment.