Class: Swivel::Visual

Inherits:
Response show all
Defined in:
lib/swivel.rb

Instance Attribute Summary

Attributes inherited from Response

#disable_auto_refresh, #hash_doc, #refreshed_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Response

#[], #id, #initialize, #method_missing, #to_param, #to_s, #to_xml

Constructor Details

This class inherits a constructor from Swivel::Response

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Swivel::Response

Class Method Details

.resourceObject



468
469
470
# File 'lib/swivel.rb', line 468

def self.resource
  'visual'
end

Instance Method Details

#image_url(options = {}) ⇒ Object

Forms the url for an image.



473
474
475
476
477
478
479
# File 'lib/swivel.rb', line 473

def image_url options={}
  options = {:format => "png", :s => Time.now.to_i, :secret => secret}.merge(options)
  host, port = @connection.config[:host], @connection.config[:port]
  port = port == 80 ? '' : ":#{port}"
  url = "http://#{host}#{port}/visuals/#{id}.#{options.delete(:format)}?#{@connection.requestify(options)}"
  
end