Class: XIVAPI::Versions

Inherits:
Object
  • Object
show all
Defined in:
lib/xivapi/versions.rb

Overview

Endpoints for querying metadata about the versions recorded by the boilmaster system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ XIVAPI::Versions

Initialize a new Versions client for making API requests.

Parameters:



9
10
11
# File 'lib/xivapi/versions.rb', line 9

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/xivapi/versions.rb', line 4

def client
  @client
end

Instance Method Details

#allArray<Hash>

List versions understood by the API.

Returns:

  • (Array<Hash>)

    The list of known versions.



15
16
17
18
# File 'lib/xivapi/versions.rb', line 15

def all
  result = client.request("version")
  result["versions"].flat_map { |v| v["names"] }
end