Class: DIDKit::ServiceRecord
- Inherits:
-
Object
- Object
- DIDKit::ServiceRecord
- Defined in:
- lib/didkit/service_record.rb
Defined Under Namespace
Classes: FormatError
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key, type, endpoint) ⇒ ServiceRecord
constructor
A new instance of ServiceRecord.
Constructor Details
#initialize(key, type, endpoint) ⇒ ServiceRecord
Returns a new instance of ServiceRecord.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/didkit/service_record.rb', line 11 def initialize(key, type, endpoint) begin uri = URI(endpoint) rescue URI::Error raise FormatError, "Invalid service endpoint: #{endpoint.inspect}" end @key = key @type = type @endpoint = endpoint end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
9 10 11 |
# File 'lib/didkit/service_record.rb', line 9 def endpoint @endpoint end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/didkit/service_record.rb', line 9 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/didkit/service_record.rb', line 9 def type @type end |