Class: YoutrackOnRails::Connection
- Inherits:
-
Object
- Object
- YoutrackOnRails::Connection
- Defined in:
- lib/youtrack_on_rails/connection.rb
Instance Attribute Summary collapse
-
#cookie ⇒ Object
readonly
Returns the value of attribute cookie.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/youtrack_on_rails/connection.rb', line 10 def initialize @uri = URI.parse(YoutrackOnRails.url) @http = Net::HTTP.new(@uri.host, @uri.port) if @uri.is_a? URI::HTTPS @http.use_ssl = true @http.verify_mode = OpenSSL::SSL::VERIFY_NONE end response = YoutrackOnRails::Requests::SignIn.new(self, login: YoutrackOnRails.login, password: YoutrackOnRails.password).response = response. end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/youtrack_on_rails/connection.rb', line 26 def method_missing(method_name, *args, &block) if (request_class = request_class_for_method(method_name)) params = args. return request_class.new(self, params).perform end super end |
Instance Attribute Details
#cookie ⇒ Object (readonly)
Returns the value of attribute cookie.
6 7 8 |
# File 'lib/youtrack_on_rails/connection.rb', line 6 def end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/youtrack_on_rails/connection.rb', line 6 def uri @uri end |