Class: Beardo
- Inherits:
-
Object
- Object
- Beardo
- Defined in:
- lib/beardo.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#group ⇒ Object
Returns the value of attribute group.
-
#password ⇒ Object
Returns the value of attribute password.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Beardo
constructor
A new instance of Beardo.
- #post(message) ⇒ Object
Constructor Details
#initialize(config) ⇒ Beardo
Returns a new instance of Beardo.
9 10 11 12 13 |
# File 'lib/beardo.rb', line 9 def initialize(config) self.group = config['group'] self.email = config['email'] self.password = config['password'] end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/beardo.rb', line 7 def email @email end |
#group ⇒ Object
Returns the value of attribute group.
7 8 9 |
# File 'lib/beardo.rb', line 7 def group @group end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/beardo.rb', line 7 def password @password end |
Class Method Details
.config_file ⇒ Object
27 28 29 |
# File 'lib/beardo.rb', line 27 def config_file File.join(config_path, '.beardorc') end |
.config_path ⇒ Object
23 24 25 |
# File 'lib/beardo.rb', line 23 def config_path ENV['HOME'] end |
.read_config ⇒ Object
36 37 38 |
# File 'lib/beardo.rb', line 36 def read_config YAML.load_file(config_file) end |
Instance Method Details
#post(message) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/beardo.rb', line 15 def post() resource = RestClient::Resource.new("http://coopapp.com", { :user => self.email, :password => self.password }) resource["groups/#{self.group}/statuses"].post("<status>#{}</status>", :content_type => 'application/xml') end |