Class: W3cApi::Hal

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/w3c_api/hal.rb

Constant Summary collapse

API_URL =
'https://api.w3.org/'

Instance Method Summary collapse

Constructor Details

#initializeHal

Returns a new instance of Hal.



12
13
14
# File 'lib/w3c_api/hal.rb', line 12

def initialize
  setup
end

Instance Method Details

#clientObject



16
17
18
# File 'lib/w3c_api/hal.rb', line 16

def client
  @client ||= Lutaml::Hal::Client.new(api_url: API_URL)
end

#registerObject



20
21
22
23
24
25
26
27
28
# File 'lib/w3c_api/hal.rb', line 20

def register
  return @register if @register

  @register = Lutaml::Hal::ModelRegister.new(name: :w3c_api, client: client)
  Lutaml::Hal::GlobalRegister.instance.register(
    :w3c_api, @register
  )
  @register
end