Class: T2Server::Administrator::AdminResource
- Inherits:
-
Object
- Object
- T2Server::Administrator::AdminResource
- Defined in:
- lib/t2-server/admin.rb
Overview
This class represents a resource in the Taverna Server administrative interface. A resource can be read only or read/write.
Resources are created when the parent Administrator class is created and are accessed via the [] method within that class.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The name of this resource.
-
#uri ⇒ Object
readonly
The URI of this resource on the server.
Instance Method Summary collapse
-
#initialize(name, uri, writeable, parent) ⇒ AdminResource
constructor
:stopdoc:.
-
#value ⇒ Object
:call-seq: value -> string value=.
-
#writable? ⇒ Boolean
:call-seq: writable? -> true or false.
Constructor Details
#initialize(name, uri, writeable, parent) ⇒ AdminResource
:stopdoc:
112 113 114 115 116 117 118 119 |
# File 'lib/t2-server/admin.rb', line 112 def initialize(name, uri, writeable, parent) @name = name @uri = uri @admin = parent @writeable = writeable make_writable if @writeable end |
Instance Attribute Details
#name ⇒ Object (readonly)
The name of this resource.
106 107 108 |
# File 'lib/t2-server/admin.rb', line 106 def name @name end |
#uri ⇒ Object (readonly)
The URI of this resource on the server.
109 110 111 |
# File 'lib/t2-server/admin.rb', line 109 def uri @uri end |
Instance Method Details
#value ⇒ Object
:call-seq:
value -> string
value=
Get or set the value held by this resource. This call always queries the server as values can change without user intervention.
The resource can only be set if it is writable.
130 131 132 |
# File 'lib/t2-server/admin.rb', line 130 def value @admin.get_resource_value(@uri) end |
#writable? ⇒ Boolean
:call-seq:
writable? -> true or false
Is this resource writable?
138 139 140 |
# File 'lib/t2-server/admin.rb', line 138 def writable? @writeable end |