Class: Rave::Models::Annotation
- Inherits:
-
Object
- Object
- Rave::Models::Annotation
- Includes:
- Rave::Mixins::ObjectFactory
- Defined in:
- lib/models/annotation.rb
Overview
An annotation applying styling or other meta-data to a section of text.
Direct Known Subclasses
Defined Under Namespace
Classes: Conversation, Language, Link, Style, User
Constant Summary collapse
- JAVA_CLASS =
"com.google.wave.api.Annotation"
Constants included from Rave::Mixins::ObjectFactory
Rave::Mixins::ObjectFactory::WILDCARD
Instance Attribute Summary
Attributes included from Rave::Mixins::ObjectFactory
Instance Method Summary collapse
-
#initialize(*args) ⇒ Annotation
constructor
:nodoc:.
-
#name ⇒ Object
Name of the annotation type [String].
-
#range ⇒ Object
Range of characters over which the annotation applies [Range].
-
#to_json ⇒ Object
:nodoc:.
-
#value ⇒ Object
Value of the annotation [String].
Methods included from Rave::Mixins::ObjectFactory
Constructor Details
#initialize(*args) ⇒ Annotation
:nodoc:
29 |
# File 'lib/models/annotation.rb', line 29 def initialize(value, range); end |
Instance Method Details
#name ⇒ Object
Name of the annotation type [String]
12 13 14 15 |
# File 'lib/models/annotation.rb', line 12 def name # :nodoc: # If @id is defined, then put that into the type, otherwise just the type is fine. @id ? type.sub(WILDCARD, @id) : type end |
#range ⇒ Object
Range of characters over which the annotation applies [Range]
23 24 25 |
# File 'lib/models/annotation.rb', line 23 def range # :nodoc: @range.dup end |
#to_json ⇒ Object
:nodoc:
43 44 45 46 47 48 49 50 |
# File 'lib/models/annotation.rb', line 43 def to_json # :nodoc: { 'javaClass' => JAVA_CLASS, 'name' => name, 'value' => value, 'range' => range, }.to_json end |
#value ⇒ Object
Value of the annotation [String]
18 19 20 |
# File 'lib/models/annotation.rb', line 18 def value # :nodoc: @value.dup end |