class SafetyRazor::Client

Client object which manages the connection to the Razor API endpoint.

@author Fletcher Nichol <fnichol@nichol.ca>

Attributes

connection[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/safety_razor/client.rb, line 22
def initialize(options = {})
  @connection = Faraday.new(:url => options[:uri]) do |faraday|
    faraday.request :url_encoded
    faraday.adapter  Faraday.default_adapter
  end
end

Public Instance Methods

active_model() click to toggle source
# File lib/safety_razor/client.rb, line 29
def active_model
  @active_model ||= Slice::ActiveModel.new(self)
end
broker() click to toggle source
# File lib/safety_razor/client.rb, line 33
def broker
  @broker ||= Slice::Broker.new(self)
end
model() click to toggle source
# File lib/safety_razor/client.rb, line 37
def model
  @model ||= Slice::Model.new(self)
end
node() click to toggle source
# File lib/safety_razor/client.rb, line 41
def node
  @node ||= Slice::Node.new(self)
end
policy() click to toggle source
# File lib/safety_razor/client.rb, line 45
def policy
  @policy ||= Slice::Policy.new(self)
end
tag() click to toggle source
# File lib/safety_razor/client.rb, line 49
def tag
  @tag ||= Slice::Tag.new(self)
end
tag_matcher() click to toggle source
# File lib/safety_razor/client.rb, line 53
def tag_matcher
  @tag_matcher ||= Slice::TagMatcher.new(self)
end