Class: RubyTCC::Client
- Inherits:
-
Object
- Object
- RubyTCC::Client
- Defined in:
- lib/rubytcc/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #application_id ⇒ String
- #application_version ⇒ String
-
#password ⇒ Object
Returns the value of attribute password.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
- #ui_language ⇒ String
- #user_agent ⇒ String
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #credentials ⇒ Hash
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ RubyTCC::Client
constructor
Initializes a new Client object.
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ RubyTCC::Client
Initializes a new Client object
13 14 15 16 17 18 19 |
# File 'lib/rubytcc/client.rb', line 13 def initialize( = {}) .each do |key, value| send(:"#{key}=", value) end yield(self) if block_given? validate_credential_type! end |
Instance Attribute Details
#application_id ⇒ String
27 28 29 |
# File 'lib/rubytcc/client.rb', line 27 def application_id @application_id end |
#application_version ⇒ String
32 33 34 |
# File 'lib/rubytcc/client.rb', line 32 def application_version @application_version end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/rubytcc/client.rb', line 5 def password @password end |
#proxy ⇒ Object
Returns the value of attribute proxy.
5 6 7 |
# File 'lib/rubytcc/client.rb', line 5 def proxy @proxy end |
#ui_language ⇒ String
37 38 39 |
# File 'lib/rubytcc/client.rb', line 37 def ui_language @ui_language end |
#user_agent ⇒ String
22 23 24 |
# File 'lib/rubytcc/client.rb', line 22 def user_agent @user_agent ||= 'Apache-HttpClient/UNAVAILABLE (java 1.4)' end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/rubytcc/client.rb', line 5 def username @username end |
Instance Method Details
#credentials ⇒ Hash
42 43 44 45 46 47 48 49 50 |
# File 'lib/rubytcc/client.rb', line 42 def credentials { :username => username, :password => password, :ApplicationId => self.application_id, :ApplicationVersion => self.application_version, :UiLanguage => self.ui_language } end |
#credentials? ⇒ Boolean
53 54 55 |
# File 'lib/rubytcc/client.rb', line 53 def credentials? credentials.values.all? end |