Class: T2Server::Administrator::AdminResource

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nameObject (readonly)

The name of this resource.



106
107
108
# File 'lib/t2-server/admin.rb', line 106

def name
  @name
end

#uriObject (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

#valueObject

: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?

Returns:

  • (Boolean)


138
139
140
# File 'lib/t2-server/admin.rb', line 138

def writable?
  @writeable
end