Sha256: bf74eef0d4f8a33cc7eacccce010e3ac4e578f7c72a70ea0a78f38d875ffe08d
Contents?: true
Size: 630 Bytes
Versions: 8
Compression:
Stored size: 630 Bytes
Contents
module Youroom class HomeTimeline < Request attr_reader :room_id, :since, :page, :flat, :read_state QUERY_KEYS = %w[since page flat read_state] 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 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 end end
Version data entries
8 entries across 8 versions & 1 rubygems