Class: OvirtSDK4::FileService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::FileService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (File) get(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (File) get(opts = {})
Returns the representation of the object managed by this service.
8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 |
# File 'lib/ovirtsdk4/services.rb', line 8035 def get(opts = {}) query = {} request = Request.new(:method => :GET, :path => @path, :query => query) response = @connection.send(request) case response.code when 200 begin reader = XmlReader.new(response.body) return FileReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
8059 8060 8061 8062 8063 8064 |
# File 'lib/ovirtsdk4/services.rb', line 8059 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (String) to_s
Returns an string representation of this service.
8071 8072 8073 |
# File 'lib/ovirtsdk4/services.rb', line 8071 def to_s return "#<#{FileService}:#{@path}>" end |