Sha256: 9234474748d620c623c37f47ed95e540aadc4420bea9c70425b02cd7091cbcf2

Contents?: true

Size: 607 Bytes

Versions: 9

Compression:

Stored size: 607 Bytes

Contents

module Youroom
  class GetEntry < Entry
    attr_reader :room_id, :mutter_id

    def initialize(access_token, room_id, mutter_id=nil, url=BASE_URL)
      required_structure(room_id, String, Symbol, Fixnum)
      required_structure(mutter_id, String, Symbol, Fixnum, NilClass)
      @room_id, @mutter_id = room_id, mutter_id
      super(access_token, url)
    end

    # Refactoring required
    def path
      if !mutter_id.nil?
        File.join(url, 'r', room_id.to_s, 'entries', mutter_id.to_s+'.json')
      else
        File.join(url, 'r', room_id.to_s, 'all?format=json')
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
youroom_api-0.1.4 lib/youroom_api/request/get_entry.rb
youroom_api-0.1.3 lib/youroom_api/request/get_entry.rb
youroom_api-0.1.2 lib/youroom_api/request/get_entry.rb
youroom_api-0.1.1 lib/youroom_api/request/get_entry.rb
youroom_api-0.1.0 lib/youroom_api/request/get_entry.rb
youroom_api-0.0.13 lib/youroom_api/request/get_entry.rb
youroom_api-0.0.12 lib/youroom_api/request/get_entry.rb
youroom_api-0.0.11 lib/youroom_api/request/get_entry.rb
youroom_api-0.0.10 lib/youroom_api/request/get_entry.rb