Guest User

Untitled

a guest
Nov 10th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.51 KB | None | 0 0
  1.     let(:client) { Rubyidescat::Client.new }
  2.     describe 'poblacio' do
  3.         it 'should set format correctly' do
  4.             client.poblacio('v1','json','dades')
  5.             expect (client.instance_variable_get(:format)).to be_equal('json')
  6.         end
  7.     end
  8.  
  9.  
  10. module Rubyidescat
  11.     class Client
  12.         BASE_URL = 'http://api.idescat.cat/'
  13.  
  14.         def initialize(attributes = {})
  15.             attributes.each do |attr, value|
  16.                 self.send("#{attr}=", value)
  17.             end
  18.         end
  19.  
  20.         def poblacio version, format, operation, *args
  21.             @format = format
  22.         end
  23.  
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment