Class: Rubyfuri::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(app_id) ⇒ Client

Returns a new instance of Client.



3
4
5
# File 'lib/rubyfuri/client.rb', line 3

def initialize(app_id)
  @app_id = app_id
end

Instance Method Details

#furu(text) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rubyfuri/client.rb', line 7

def furu(text)
  if text.class == String
    sentence = text
    res = YahooAPI.request(@app_id, sentence)
    ResponseParsers::String.new(text, res.body).ruby
  else text.class == Array
    sentence = text.join
    res = YahooAPI.request(@app_id, sentence)
    ResponseParsers::Array.new(text, res.body).ruby
  end
end