Class: Dice::Client
Instance Attribute Summary collapse
-
#area_coode ⇒ Object
attr_reader :uri, :options.
-
#city ⇒ Object
attr_reader :uri, :options.
-
#country ⇒ Object
attr_reader :uri, :options.
-
#page ⇒ Object
attr_reader :uri, :options.
-
#skill ⇒ Object
attr_reader :uri, :options.
-
#state ⇒ Object
attr_reader :uri, :options.
-
#text ⇒ Object
attr_reader :uri, :options.
Instance Method Summary collapse
- #encoded_uri ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #search ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dice/client.rb', line 12 def initialize( = {}) self.text = [:text] || '' self.area_coode = [:area_coode] || '' self.country = [:country] || '' self.state = [:state] || '' self.skill = [:skill] || '' self.city = [:city] || '' self.text = [:text] || '' self.page = [:page] || '' end |
Instance Attribute Details
#area_coode ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def area_coode @area_coode end |
#city ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def city @city end |
#country ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def country @country end |
#page ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def page @page end |
#skill ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def skill @skill end |
#state ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def state @state end |
#text ⇒ Object
attr_reader :uri, :options
10 11 12 |
# File 'lib/dice/client.rb', line 10 def text @text end |
Instance Method Details
#encoded_uri ⇒ Object
29 30 31 |
# File 'lib/dice/client.rb', line 29 def encoded_uri URI.encode("?text=#{self.text}&areacode=#{self.area_coode}&country=#{self.country}&state=#{self.state}&skill=#{self.skill}&city=#{self.city}&page=#{self.page}") end |