Sha256: 23c3bb9303c8d2a06c011b4f23cd6dba5021bd5184f5a9410dbf1e82c6fe80b9
Contents?: true
Size: 819 Bytes
Versions: 1
Compression:
Stored size: 819 Bytes
Contents
class YouTrack::Client::Request def find(collection, id, options={}) service.data.fetch(collection)[id] || service.response( :status => options[:error_status] || 404, :body => { "error" => options[:error_message] || "#{collection.to_s.gsub(/s\Z/, "").capitalize} not found." } ) end def require_parameters(_params, *_requirements) params = Cistern::Hash.stringify_keys(_params) requirements = _requirements.map(&:to_s) requirements.each do |requirement| unless !params[requirement].nil? response( :status => 400, :body => {"error" => "Bad Request"}) end end values = params.values_at(*requirements) values.size == 1 ? values.first : values end def ms_time(time=Time.now) time.to_i * 1000 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
you_track-0.4.8 | lib/you_track/client/request.rb |