Class: Youroom::PostEntry
- Defined in:
- lib/youroom_api/request/post_entry.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#room_id ⇒ Object
readonly
Returns the value of attribute room_id.
Attributes inherited from Request
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(access_token, room_id, content, parent_id = nil, url = BASE_URL) ⇒ PostEntry
constructor
A new instance of PostEntry.
- #params ⇒ Object
- #path ⇒ Object
Methods inherited from Request
#create_entry, #create_participation, #create_room, #create_user, #delete, #destroy_entry, #destroy_participation, #get, #get_all_timeline, #get_attachment, #get_entry, #get_my_group, #get_picture, #get_room_list, #get_room_timeline, #get_unread_timeline, #get_user_list, #get_verify_credentials, #mark_read, #mark_unread, #post
Constructor Details
#initialize(access_token, room_id, content, parent_id = nil, url = BASE_URL) ⇒ PostEntry
Returns a new instance of PostEntry.
5 6 7 8 9 |
# File 'lib/youroom_api/request/post_entry.rb', line 5 def initialize(access_token, room_id, content, parent_id=nil, url=BASE_URL) [room_id, content].each { |arg| required_structure(arg, String, Symbol, Fixnum) } @room_id, @content, @parent_id = room_id, content, parent_id super(access_token, url) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/youroom_api/request/post_entry.rb', line 3 def content @content end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
3 4 5 |
# File 'lib/youroom_api/request/post_entry.rb', line 3 def parent_id @parent_id end |
#room_id ⇒ Object (readonly)
Returns the value of attribute room_id.
3 4 5 |
# File 'lib/youroom_api/request/post_entry.rb', line 3 def room_id @room_id end |
Instance Method Details
#params ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/youroom_api/request/post_entry.rb', line 15 def params if parent_id { :entry => { :content => content.to_s, :parent_id => parent_id }, :insert_mention => "" } else { :entry => { :content => content.to_s }, :insert_mention => "" } end.optimize end |
#path ⇒ Object
11 12 13 |
# File 'lib/youroom_api/request/post_entry.rb', line 11 def path File.join(url, 'r', room_id.to_s, 'entries?format=json') end |