Class: Beanstalk::API::Base
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- Beanstalk::API::Base
show all
- Defined in:
- lib/beanstalkapp/base.rb
Direct Known Subclasses
Account, Changeset, Comment, Permission, Plan, PublicKey, Release, ReleaseServer, Repository, ServerEnvironment, User
Class Method Summary
collapse
Class Method Details
.add_prefix(str) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/beanstalkapp/base.rb', line 11
def self.add_prefix(str)
str.gsub!(/^\//, '')
class_eval(<<-CODE)
def self.site
URI.parse(File.join(Beanstalk::API::Base.site.to_s, #{str.inspect}))
end
CODE
end
|
.setup(options) ⇒ Object
4
5
6
7
8
9
|
# File 'lib/beanstalkapp/base.rb', line 4
def self.setup(options)
options[:host] ||= "beanstalkapp.com"
self.site = "http://#{options[:domain]}.#{options[:host]}/api"
self.user = options[:login]
self.password = options[:password]
end
|