Module: Boty::Slack::URL

Included in:
Chat, IM, RTM, Users
Defined in:
lib/boty/slack/url.rb

Class Method Summary collapse

Class Method Details

.get(url) ⇒ Object



16
17
18
# File 'lib/boty/slack/url.rb', line 16

def self.get(url)
  JSON.parse Net::HTTP.get(URI(url)) || "{}"
end

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/boty/slack/url.rb', line 4

def self.included(base)
  class << base
    attr_reader :_url
  end

  base.instance_eval do
    def url(url)
      @_url = url
    end
  end
end