Class: DIDKit::ServiceRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/didkit/service_record.rb

Defined Under Namespace

Classes: FormatError

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#endpointObject (readonly)

Returns the value of attribute endpoint.



9
10
11
# File 'lib/didkit/service_record.rb', line 9

def endpoint
  @endpoint
end

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/didkit/service_record.rb', line 9

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/didkit/service_record.rb', line 9

def type
  @type
end