Module: Mite
- Defined in:
- lib/mite-rb.rb,
lib/mite/version.rb
Overview
The official ruby library for interacting with the RESTful API of mite, a sleek time tracking webapp.
Defined Under Namespace
Modules: ResourceWithActiveArchived, ResourceWithoutWriteAccess Classes: Account, Base, Customer, MethodNotAvaible, Myself, Project, Service, SingletonBase, TimeEntry, TimeEntryGroup, Tracker, User
Constant Summary collapse
- VERSION =
"0.5.4"
Class Attribute Summary collapse
-
.account ⇒ Object
Returns the value of attribute account.
-
.domain_format ⇒ Object
Returns the value of attribute domain_format.
-
.email ⇒ Object
Returns the value of attribute email.
-
.host_format ⇒ Object
Returns the value of attribute host_format.
-
.key ⇒ Object
Returns the value of attribute key.
-
.password ⇒ Object
Returns the value of attribute password.
-
.port ⇒ Object
Returns the value of attribute port.
-
.protocol ⇒ Object
Returns the value of attribute protocol.
-
.user_agent ⇒ Object
Returns the value of attribute user_agent.
Class Method Summary collapse
-
.authenticate(user, password) ⇒ Object
Sets up basic authentication credentials for all resources.
- .resources ⇒ Object
-
.validate ⇒ Object
Validates connection returns true when valid false when not.
-
.validate! ⇒ Object
Same as validate_connection but raises http-error when connection is invalid.
- .version ⇒ Object
Class Attribute Details
.account ⇒ Object
Returns the value of attribute account.
13 14 15 |
# File 'lib/mite-rb.rb', line 13 def account @account end |
.domain_format ⇒ Object
Returns the value of attribute domain_format.
12 13 14 |
# File 'lib/mite-rb.rb', line 12 def domain_format @domain_format end |
.email ⇒ Object
Returns the value of attribute email.
12 13 14 |
# File 'lib/mite-rb.rb', line 12 def email @email end |
.host_format ⇒ Object
Returns the value of attribute host_format.
12 13 14 |
# File 'lib/mite-rb.rb', line 12 def host_format @host_format end |
.key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/mite-rb.rb', line 13 def key @key end |
.password ⇒ Object
Returns the value of attribute password.
12 13 14 |
# File 'lib/mite-rb.rb', line 12 def password @password end |
.port ⇒ Object
Returns the value of attribute port.
12 13 14 |
# File 'lib/mite-rb.rb', line 12 def port @port end |
.protocol ⇒ Object
Returns the value of attribute protocol.
13 14 15 |
# File 'lib/mite-rb.rb', line 13 def protocol @protocol end |
.user_agent ⇒ Object
Returns the value of attribute user_agent.
13 14 15 |
# File 'lib/mite-rb.rb', line 13 def user_agent @user_agent end |
Class Method Details
.authenticate(user, password) ⇒ Object
Sets up basic authentication credentials for all resources.
24 25 26 27 28 29 30 31 32 |
# File 'lib/mite-rb.rb', line 24 def authenticate(user, password) resources.each do |klass| klass.user = user klass.password = password end @user = user @password = password true end |
.resources ⇒ Object
54 55 56 |
# File 'lib/mite-rb.rb', line 54 def resources @resources ||= [] end |
.validate ⇒ Object
Validates connection returns true when valid false when not
60 61 62 |
# File 'lib/mite-rb.rb', line 60 def validate validate! rescue false end |