module ShowroomApi
This module represents showroom_api gem
Constants
- VERSION
Protected Class Methods
showroom_live_get_api_data(url)
click to toggle source
performs http request to showroom
@param url [String] @return [Hash]
# File lib/showroom_api.rb, line 362 def self.showroom_live_get_api_data(url) begin uri = URI(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) return JSON.parse(response.read_body,:symbolize_names => true) rescue return {} end end
to_integer(num)
click to toggle source
convert string to valid integer
@param num [String] @return [Integer]
# File lib/showroom_api.rb, line 380 def self.to_integer(num) return nil if num.nil? return num.to_i if num.to_i.to_s == num.to_s return nil end