Class: Hastests::Data
Instance Method Summary collapse
- #generate(seed = nil) ⇒ Object
-
#initialize(script, account) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(script, account) ⇒ Data
Returns a new instance of Data.
12 13 14 15 |
# File 'lib/hastests/data.rb', line 12 def initialize(script,account) @account = account @params = {:q => script, :api_token => @account.token } end |
Instance Method Details
#generate(seed = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/hastests/data.rb', line 17 def generate(seed=nil) params = @params.clone if seed!=nil params[:seed]=seed end response = RestClient.get(@account.url + Hastests::API_PATH, :user_agent => Hastests::USER_AGENT, :params => params) return JSON.parse(response.body) end |