app/models/sws/web_service_result.rb
def document(options = {})
    cache = FileStoreWithExpiration.new("tmp/cache/web_service_result/#{self.class.to_s}")
    options[:extension] = '.json'
    cache_key = options[:extension] ? "#{@id.to_s}#{options[:extension]}" : @id.to_s
    @raw = cache.fetch(cache_key, {:expires_in => self.class.cache_lifetime}.merge(options)) do
      connection.get(constructed_path(options[:extension]))
    end  
    self.class.encapsulate_data(@raw)
  end
# Returns an encapsulated object of Json data returned by the service. Also manages the
# cache and requeries the service if needed. Caches of the raw json are stored in
# Rails.root/tmp/cache/web_service_result/<class_name>/<primary_key><extension>
Returns an encapsulated object of Json data returned by the service. Also manages the
cache and requeries the service if needed.
Returns an encapsulated object of Json data returned by the service . Also manages the cache and requeries the service if needed .
def document(options = {})
    cache = FileStoreWithExpiration.new("tmp/cache/web_service_result/#{self.class.to_s}")
    options[:extension] = '.json'
    cache_key = options[:extension] ? "#{@id.to_s}#{options[:extension]}" : @id.to_s
    @raw = cache.fetch(cache_key, {:expires_in => self.class.cache_lifetime}.merge(options)) do
      connection.get(constructed_path(options[:extension]))
    end  
    self.class.encapsulate_data(@raw)
  end
def document ( options = { } ) cache = FileStoreWithExpiration . new ( "tmp/cache/web_service_result/#{self.class.to_s}" ) options [ :extension ] = '.json' cache_key = options [ :extension ] ? "#{@id.to_s}#{options[:extension]}" : @id . to_s @raw = cache . fetch ( cache_key , { :expires_in => self . class . cache_lifetime } . merge ( options ) ) do connection . get ( constructed_path ( options [ :extension ] ) ) end self . class . encapsulate_data ( @raw ) end
Returns an encapsulated object of Json data returned by the service.
Returns an encapsulated object of Json data returned by the service .
options