Class: W3cApi::Hal
Constant Summary collapse
- API_URL =
'https://api.w3.org/'
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize ⇒ Hal
constructor
A new instance of Hal.
- #register ⇒ Object
- #reset_register ⇒ Object
Constructor Details
#initialize ⇒ Hal
Returns a new instance of Hal.
43 44 45 |
# File 'lib/w3c_api/hal.rb', line 43 def initialize # Don't call setup here - it will be called when register is first accessed end |
Instance Method Details
#client ⇒ Object
47 48 49 |
# File 'lib/w3c_api/hal.rb', line 47 def client @client ||= Lutaml::Hal::Client.new(api_url: API_URL) end |
#register ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/w3c_api/hal.rb', line 51 def register return @register if @register @register = Lutaml::Hal::ModelRegister.new(name: :w3c_api, client: client) Lutaml::Hal::GlobalRegister.instance.register(:w3c_api, @register) # Re-run setup to register all endpoints with the new register setup @register end |
#reset_register ⇒ Object
63 64 65 |
# File 'lib/w3c_api/hal.rb', line 63 def reset_register @register = nil end |