Class: Redfinger::Client
- Inherits:
-
Object
- Object
- Redfinger::Client
- Defined in:
- lib/redfinger/client.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#uri_template ⇒ Object
Returns the value of attribute uri_template.
Instance Method Summary collapse
- #finger ⇒ Object
-
#initialize(email, uri_template = nil) ⇒ Client
constructor
A new instance of Client.
- #xrd_url(ssl = true) ⇒ Object
Constructor Details
#initialize(email, uri_template = nil) ⇒ Client
Returns a new instance of Client.
9 10 11 12 |
# File 'lib/redfinger/client.rb', line 9 def initialize(email, uri_template = nil) self.account = urify(email) self.domain = account.split('@').last end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
7 8 9 |
# File 'lib/redfinger/client.rb', line 7 def account @account end |
#domain ⇒ Object
Returns the value of attribute domain.
7 8 9 |
# File 'lib/redfinger/client.rb', line 7 def domain @domain end |
#uri_template ⇒ Object
Returns the value of attribute uri_template.
7 8 9 |
# File 'lib/redfinger/client.rb', line 7 def uri_template @uri_template end |
Instance Method Details
#finger ⇒ Object
14 15 16 17 |
# File 'lib/redfinger/client.rb', line 14 def finger self.uri_template ||= retrieve_template_from_xrd Finger.new RestClient.get(swizzle) end |
#xrd_url(ssl = true) ⇒ Object
19 20 21 |
# File 'lib/redfinger/client.rb', line 19 def xrd_url(ssl = true) "http#{'s' if ssl}://#{domain}/.well-known/host-meta" end |