Module: Remotable::Adapters::ActiveResource::ClassMethods

Defined in:
lib/remotable/adapters/active_resource.rb

Instance Method Summary collapse

Instance Method Details

#expanded_path_for(path) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/remotable/adapters/active_resource.rb', line 30

def expanded_path_for(path)
  if relative_path?(path)
    URI.join_url_segments(prefix, collection_name, "#{path}.#{format.extension}")
  else
    path
  end
end

#find_by(path) ⇒ Object



23
24
25
26
27
# File 'lib/remotable/adapters/active_resource.rb', line 23

def find_by(path)
  find_by!(path)
rescue ::ActiveResource::ResourceNotFound
  nil
end

#find_by!(path) ⇒ Object



19
20
21
# File 'lib/remotable/adapters/active_resource.rb', line 19

def find_by!(path)
  find(:one, :from => expanded_path_for(path))
end

#new_resourceObject



14
15
16
# File 'lib/remotable/adapters/active_resource.rb', line 14

def new_resource
  new
end