Class: Youroom::RoomTimeline
- Defined in:
- lib/youroom_api/request/room_timeline.rb
Constant Summary collapse
- QUERY_KEYS =
%w[since page flat search_query read_state]
Instance Attribute Summary collapse
-
#flat ⇒ Object
readonly
Returns the value of attribute flat.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#read_state ⇒ Object
readonly
Returns the value of attribute read_state.
-
#room_id ⇒ Object
readonly
Returns the value of attribute room_id.
-
#search_query ⇒ Object
readonly
Returns the value of attribute search_query.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
Attributes inherited from Request
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(access_token, room_id, params = {}, url = BASE_URL) ⇒ RoomTimeline
constructor
A new instance of RoomTimeline.
- #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, params = {}, url = BASE_URL) ⇒ RoomTimeline
Returns a new instance of RoomTimeline.
6 7 8 9 10 11 12 |
# File 'lib/youroom_api/request/room_timeline.rb', line 6 def initialize(access_token, room_id, params={}, url=BASE_URL) required_structure(room_id, String, Symbol, Fixnum) required_structure(params, Hash) @room_id = room_id params.each { |k,v| self.instance_variable_set("@#{k}", v)} super(access_token, url) end |
Instance Attribute Details
#flat ⇒ Object (readonly)
Returns the value of attribute flat.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def flat @flat end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def page @page end |
#read_state ⇒ Object (readonly)
Returns the value of attribute read_state.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def read_state @read_state end |
#room_id ⇒ Object (readonly)
Returns the value of attribute room_id.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def room_id @room_id end |
#search_query ⇒ Object (readonly)
Returns the value of attribute search_query.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def search_query @search_query end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
3 4 5 |
# File 'lib/youroom_api/request/room_timeline.rb', line 3 def since @since end |
Instance Method Details
#path ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/youroom_api/request/room_timeline.rb', line 14 def path query_str = "&" QUERY_KEYS.each do |query_key| val = self.instance_variable_get("@#{query_key}") query_str += "#{query_key}=#{val}&" if !val.nil? end File.join(url, 'r', room_id.to_s, '?format=json'+"#{query_str.chop}") end |