Class: Autodiscover::Client
- Inherits:
-
Object
- Object
- Autodiscover::Client
- Defined in:
- lib/autodiscover/client.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
- #autodiscover(type: :pox, **options) ⇒ Object
-
#initialize(email:, password:, username: nil, domain: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(email:, password:, username: nil, domain: nil) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 |
# File 'lib/autodiscover/client.rb', line 13 def initialize(email:, password:, username: nil, domain: nil) @email = email @domain = domain || @email.split("@").last @http = HTTPClient.new @username = username || email @http.set_auth(nil, @username, password) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
4 5 6 |
# File 'lib/autodiscover/client.rb', line 4 def domain @domain end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
4 5 6 |
# File 'lib/autodiscover/client.rb', line 4 def email @email end |
#http ⇒ Object (readonly)
Returns the value of attribute http.
4 5 6 |
# File 'lib/autodiscover/client.rb', line 4 def http @http end |
Instance Method Details
#autodiscover(type: :pox, **options) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/autodiscover/client.rb', line 23 def autodiscover(type: :pox, **) case type when :pox PoxRequest.new(self, **).autodiscover else raise Autodiscover::ArgumentError, "Not a valid autodiscover type (#{type})." end end |