Class: Tinyembedly::Service
- Inherits:
-
Object
- Object
- Tinyembedly::Service
- Includes:
- HTTParty
- Defined in:
- lib/tinyembedly/service.rb
Class Method Summary collapse
Class Method Details
.services ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/tinyembedly/service.rb', line 5 def self.services if !defined?(@@services) || @@services.nil? res = get("http://#{BASE_URI}/1/services/ruby") @@services = res.code == 200 ? res.parsed_response : nil end @@services end |
.services_regex ⇒ Object
13 14 15 16 17 18 |
# File 'lib/tinyembedly/service.rb', line 13 def self.services_regex if services.is_a?(Array) r = services.collect { |service| service['regex'].join('|') }.join('|') Regexp.new("^(#{r})$") end end |