Class: OpenWFE::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/openwfe/orest/workitem.rb

Overview

Models the information about a store as viewed by the current user (upon calling the listStores or getStoreNames methods)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStore

Returns a new instance of Store.



87
88
89
90
91
92
# File 'lib/openwfe/orest/workitem.rb', line 87

def initialize ()
    super()
    #@name = nil
    #@workitem_count = nil
    #@permissions = nil
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



85
86
87
# File 'lib/openwfe/orest/workitem.rb', line 85

def name
  @name
end

#permissionsObject

Returns the value of attribute permissions.



85
86
87
# File 'lib/openwfe/orest/workitem.rb', line 85

def permissions
  @permissions
end

#workitem_countObject

Returns the value of attribute workitem_count.



85
86
87
# File 'lib/openwfe/orest/workitem.rb', line 85

def workitem_count
  @workitem_count
end

Instance Method Details

#may_browse?Boolean

Returns true if the current user may browse the headers of this store

Returns:

  • (Boolean)


114
115
116
# File 'lib/openwfe/orest/workitem.rb', line 114

def may_browse? ()
    @permissions.index('b') > -1
end

#may_delegate?Boolean

Returns true if the current user may delegate workitems to this store

Returns:

  • (Boolean)


121
122
123
# File 'lib/openwfe/orest/workitem.rb', line 121

def may_delegate? ()
    @permissions.index('d') > -1
end

#may_read?Boolean

Returns true if the current user may read headers and workitems from this store

Returns:

  • (Boolean)


98
99
100
# File 'lib/openwfe/orest/workitem.rb', line 98

def may_read? ()
    return @permissions.index('r') > -1
end

#may_write?Boolean

Returns true if the current user may modify workitems (and at least proceed/forward them) in this store

Returns:

  • (Boolean)


106
107
108
# File 'lib/openwfe/orest/workitem.rb', line 106

def may_write? ()
    @permissions.index('w') > -1
end