Class: OpenWFE::Base64Attribute

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

Overview

a wrapper for some binary content

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base64content) ⇒ Base64Attribute

Returns a new instance of Base64Attribute.



154
155
156
157
# File 'lib/openwfe/orest/workitem.rb', line 154

def initialize (base64content)

    @content = base64content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



152
153
154
# File 'lib/openwfe/orest/workitem.rb', line 152

def content
  @content
end

Class Method Details

.wrap(binaryData) ⇒ Object

wraps some binary content and stores it in this attribute (class method)



171
172
173
174
# File 'lib/openwfe/orest/workitem.rb', line 171

def Base64Attribute.wrap (binaryData)

    Base64Attribute.new(Base64.encode64(binaryData))
end

Instance Method Details

#dewrapObject

dewraps (decode) the current content and returns it



162
163
164
165
# File 'lib/openwfe/orest/workitem.rb', line 162

def dewrap ()

    Base64.decode64(@content)
end