Class: Fnf::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/fnf/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



5
6
7
# File 'lib/fnf/client.rb', line 5

def params
  @params
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/fnf/client.rb', line 5

def url
  @url
end

#verbObject

Returns the value of attribute verb.



5
6
7
# File 'lib/fnf/client.rb', line 5

def verb
  @verb
end

Class Method Details

.get_verb(hsh) ⇒ Object



15
16
17
18
19
# File 'lib/fnf/client.rb', line 15

def self.get_verb(hsh)
  [:delete, :get, :post, :put, :head].each do |verb|
    return verb if hsh[verb]
  end
end

.queue(hsh) ⇒ Object



7
8
9
10
11
12
# File 'lib/fnf/client.rb', line 7

def self.queue(hsh)
  verb = get_verb(hsh)
  url = hsh[verb]
  params = hsh[:params]
  FifoWriter.write_to_fifo "#{[verb,url,params].to_msgpack}\n"
end