Class: Shared::Security

Inherits:
Object
  • Object
show all
Defined in:
lib/vas/shared/security.rb

Overview

The security configuration for a resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupString (readonly)

Returns the group of the resource.

Returns:

  • (String)

    the group of the resource



29
30
31
# File 'lib/vas/shared/security.rb', line 29

def group
  @group
end

#locationObject (readonly)



32
33
34
# File 'lib/vas/shared/security.rb', line 32

def location
  @location
end

#ownerString (readonly)

Returns the owner of the resource.

Returns:

  • (String)

    the owner of the resource



26
27
28
# File 'lib/vas/shared/security.rb', line 26

def owner
  @owner
end

#permissionsHash (readonly)

Returns The permissions of the resource.

Returns:

  • (Hash)

    The permissions of the resource



23
24
25
# File 'lib/vas/shared/security.rb', line 23

def permissions
  @permissions
end

Instance Method Details

#reloadObject

Reloads the security configuration from server



48
49
50
51
52
53
# File 'lib/vas/shared/security.rb', line 48

def reload
  json = @client.get(location)
  @owner = json["owner"]
  @group = json["group"]
  @permissions = json["permissions"]
end

#to_sString

Returns a string representation of this security object.

Returns:

  • (String)

    a string representation of this security object



56
57
58
# File 'lib/vas/shared/security.rb', line 56

def to_s
  "#<#{self.class} owner='#@owner' group='#@group' permissions='#@permissions'>"
end