Class: Nelumba::Note
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
-
#initialize(options = {}, &blk) ⇒ Note
constructor
Create a new note.
-
#to_hash ⇒ Object
Returns a hash of all relevant fields.
-
#to_json_hash ⇒ Object
Returns a hash of all relevant fields with JSON activity streams conventions.
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( = {}, &blk) init(, &blk) end |
Instance Method Details
#to_hash ⇒ Object
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_hash ⇒ Object
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 |