class Azure::Core::FilteredService
A base class for Service implementations
Attributes
filters[RW]
Public Class Methods
new(host='', options={})
click to toggle source
Create a new instance of the FilteredService
@param host [String] The hostname. (optional, Default empty) @param options [Hash] options including {:client} (optional, Default {})
Calls superclass method
# File lib/azure/core/filtered_service.rb, line 26 def initialize(host='', options={}) super @filters = [] end
Public Instance Methods
call(method, uri, body=nil, headers=nil)
click to toggle source
Calls superclass method
# File lib/azure/core/filtered_service.rb, line 33 def call(method, uri, body=nil, headers=nil) super(method, uri, body, headers) do |request| filters.each { |filter| request.with_filter filter } if filters end end
with_filter(filter=nil, &block)
click to toggle source
# File lib/azure/core/filtered_service.rb, line 39 def with_filter(filter=nil, &block) filter = filter || block filters.push filter if filter end