Class: Youroom::HomeTimeline
- Defined in:
- lib/youroom_api/request/timeline.rb
Constant Summary collapse
- QUERY_KEYS =
%w[since page flat 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.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
Attributes inherited from Request
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(access_token, params = {}, url = BASE_URL) ⇒ HomeTimeline
constructor
A new instance of HomeTimeline.
- #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, params = {}, url = BASE_URL) ⇒ HomeTimeline
Returns a new instance of HomeTimeline.
6 7 8 9 10 |
# File 'lib/youroom_api/request/timeline.rb', line 6 def initialize(access_token, params={}, url=BASE_URL) required_structure(params, Hash) 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/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/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/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/timeline.rb', line 3 def room_id @room_id end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
3 4 5 |
# File 'lib/youroom_api/request/timeline.rb', line 3 def since @since end |
Instance Method Details
#path ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/youroom_api/request/timeline.rb', line 12 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, '?format=json'+"#{query_str.chop}") end |