Class: Pushnote::Note
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#df_report ⇒ Object
readonly
Returns the value of attribute df_report.
-
#title ⇒ Object
Returns the value of attribute title.
-
#top_report ⇒ Object
readonly
Returns the value of attribute top_report.
Instance Method Summary collapse
- #collect_system_info ⇒ Object
-
#initialize ⇒ Note
constructor
A new instance of Note.
- #save ⇒ Object
- #set_server_host(host) ⇒ Object
Constructor Details
#initialize ⇒ Note
Returns a new instance of Note.
12 13 14 |
# File 'lib/pushnote/note.rb', line 12 def initialize set_server_host(configuration.server) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
9 10 11 |
# File 'lib/pushnote/note.rb', line 9 def body @body end |
#df_report ⇒ Object (readonly)
Returns the value of attribute df_report.
10 11 12 |
# File 'lib/pushnote/note.rb', line 10 def df_report @df_report end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/pushnote/note.rb', line 9 def title @title end |
#top_report ⇒ Object (readonly)
Returns the value of attribute top_report.
10 11 12 |
# File 'lib/pushnote/note.rb', line 10 def top_report @top_report end |
Instance Method Details
#collect_system_info ⇒ Object
24 25 26 27 28 29 |
# File 'lib/pushnote/note.rb', line 24 def collect_system_info [ Thread.new { create_top_report }, Thread.new { create_df_report } ].each(&:join) end |
#save ⇒ Object
16 17 18 |
# File 'lib/pushnote/note.rb', line 16 def save self.class.post('/', { body: serialize.to_json }) end |
#set_server_host(host) ⇒ Object
20 21 22 |
# File 'lib/pushnote/note.rb', line 20 def set_server_host(host) self.class.base_uri(host) end |