Class: OpenWFE::Base64Attribute
- Inherits:
-
Object
- Object
- OpenWFE::Base64Attribute
- Defined in:
- lib/openwfe/orest/workitem.rb
Overview
a wrapper for some binary content
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Class Method Summary collapse
-
.wrap(binaryData) ⇒ Object
wraps some binary content and stores it in this attribute (class method).
Instance Method Summary collapse
-
#dewrap ⇒ Object
dewraps (decode) the current content and returns it.
-
#initialize(base64content) ⇒ Base64Attribute
constructor
A new instance of Base64Attribute.
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
#content ⇒ Object
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
#dewrap ⇒ Object
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 |