Class: Nelumba::Note

Inherits:
Object
  • Object
show all
Includes:
Object
Defined in:
lib/nelumba/note.rb

Constant Summary

Constants included from Object

Object::USERNAME_REGULAR_EXPRESSION

Instance Attribute Summary

Attributes included from Object

#author, #content, #display_name, #html, #image, #published, #summary, #text, #title, #uid, #updated, #url

Instance Method Summary collapse

Methods included from Object

#init, #mentions, #reply_to, #to_as1, #to_html, #to_json, #to_text

Constructor Details

#initialize(options = {}, &blk) ⇒ Note

Create a new note.

options:

:title        => The title of the note. Defaults: "Untitled"
:text         => The content of the note. Defaults: ""
:html         => The content of the note as html.
:author       => An Person that wrote the note.
:url          => Permanent location for an html representation of the
                 note.
:published    => When the note was originally published.
:updated      => When the note was last updated.
:uid          => The unique id that identifies this note.


17
18
19
# File 'lib/nelumba/note.rb', line 17

def initialize(options = {}, &blk)
  init(options, &blk)
end

Instance Method Details

#to_hashObject

Returns a hash of all relevant fields.



22
23
24
# File 'lib/nelumba/note.rb', line 22

def to_hash
  super.to_hash
end

#to_json_hashObject

Returns a hash of all relevant fields with JSON activity streams conventions.



28
29
30
31
32
# File 'lib/nelumba/note.rb', line 28

def to_json_hash
  {
    :objectType => "note",
  }.merge(super)
end