Class: Rave::Models::Operation
- Inherits:
-
Object
- Object
- Rave::Models::Operation
- Defined in:
- lib/models/operation.rb
Overview
Represents an operation to be applied on the server.
Constant Summary collapse
- JAVA_CLASS =
:nodoc:
'com.google.wave.api.impl.OperationImpl'
- WAVELET_APPEND_BLIP =
Constants Types of operations
'WAVELET_APPEND_BLIP'
- WAVELET_ADD_PARTICIPANT =
'WAVELET_ADD_PARTICIPANT'
- WAVELET_REMOVE_PARTICIPANT =
'WAVELET_REMOVE_PARTICIPANT'
- WAVELET_CREATE =
'WAVELET_CREATE'
- WAVELET_REMOVE_SELF =
'WAVELET_REMOVE_SELF'
- WAVELET_DATADOC_SET =
'WAVELET_DATADOC_SET'
- WAVELET_SET_TITLE =
'WAVELET_SET_TITLE'
- BLIP_CREATE_CHILD =
'BLIP_CREATE_CHILD'
- BLIP_DELETE =
'BLIP_DELETE'
- DOCUMENT_ANNOTATION_DELETE =
'DOCUMENT_ANNOTATION_DELETE'
- DOCUMENT_ANNOTATION_SET =
'DOCUMENT_ANNOTATION_SET'
- DOCUMENT_ANNOTATION_SET_NORANGE =
'DOCUMENT_ANNOTATION_SET_NORANGE'
- DOCUMENT_APPEND =
Plain text
'DOCUMENT_APPEND'
- DOCUMENT_APPEND_MARKUP =
HTML
'DOCUMENT_APPEND_MARKUP'
- DOCUMENT_APPEND_STYLED_TEXT =
'DOCUMENT_APPEND_STYLED_TEXT'
- DOCUMENT_INSERT =
'DOCUMENT_INSERT'
- DOCUMENT_DELETE =
'DOCUMENT_DELETE'
- DOCUMENT_REPLACE =
'DOCUMENT_REPLACE'
- DOCUMENT_ELEMENT_APPEND =
'DOCUMENT_ELEMENT_APPEND'
- DOCUMENT_ELEMENT_DELETE =
'DOCUMENT_ELEMENT_DELETE'
- DOCUMENT_ELEMENT_INSERT =
'DOCUMENT_ELEMENT_INSERT'
- DOCUMENT_ELEMENT_INSERT_AFTER =
'DOCUMENT_ELEMENT_INSERT_AFTER'
- DOCUMENT_ELEMENT_INSERT_BEFORE =
'DOCUMENT_ELEMENT_INSERT_BEFORE'
- DOCUMENT_ELEMENT_REPLACE =
'DOCUMENT_ELEMENT_REPLACE'
- DOCUMENT_INLINE_BLIP_APPEND =
'DOCUMENT_INLINE_BLIP_APPEND'
- DOCUMENT_INLINE_BLIP_DELETE =
'DOCUMENT_INLINE_BLIP_DELETE'
- DOCUMENT_INLINE_BLIP_INSERT =
'DOCUMENT_INLINE_BLIP_INSERT'
- DOCUMENT_INLINE_BLIP_INSERT_AFTER_ELEMENT =
'DOCUMENT_INLINE_BLIP_INSERT_AFTER_ELEMENT'
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
:nodoc:.
-
#property ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
- #blip_id ⇒ Object
-
#initialize(options = {}) ⇒ Operation
constructor
Options include: - :type - :wave_id - :wavelet_id - :blip_id - :index - :property.
-
#to_json ⇒ Object
Serialize the operation to json.
- #type ⇒ Object
- #wave_id ⇒ Object
- #wavelet_id ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Operation
Options include:
-
:type
-
:wave_id
-
:wavelet_id
-
:blip_id
-
:index
-
:property
52 53 54 55 56 57 58 59 |
# File 'lib/models/operation.rb', line 52 def initialize( = {}) @type = [:type] @wave_id = [:wave_id] @wavelet_id = [:wavelet_id] || '' @blip_id = [:blip_id] || '' @index = [:index] || -1 @property = [:property] end |
Instance Attribute Details
#index ⇒ Object (readonly)
:nodoc:
5 6 7 |
# File 'lib/models/operation.rb', line 5 def index @index end |
#property ⇒ Object (readonly)
:nodoc:
5 6 7 |
# File 'lib/models/operation.rb', line 5 def property @property end |
Instance Method Details
#blip_id ⇒ Object
10 |
# File 'lib/models/operation.rb', line 10 def blip_id; @blip_id.dup; end |
#to_json ⇒ Object
Serialize the operation to json
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/models/operation.rb', line 62 def to_json hash = { 'blipId' => @blip_id, 'index' => @index, 'waveletId' => @wavelet_id, 'waveId' => @wave_id, 'type' => @type, 'javaClass' => JAVA_CLASS } hash['property'] = @property unless @property.nil? hash.to_json end |
#type ⇒ Object
7 |
# File 'lib/models/operation.rb', line 7 def type; @type.dup; end |
#wave_id ⇒ Object
8 |
# File 'lib/models/operation.rb', line 8 def wave_id; @wave_id.dup; end |
#wavelet_id ⇒ Object
9 |
# File 'lib/models/operation.rb', line 9 def wavelet_id; @wavelet_id.dup; end |