class

ServiceStatus::Settings

Inherits JSON::Serializable < Reference < Object

sources.service_status セクション。

Constants

DEFAULT_FEED_URL = "https://vrc-status.oxymoron.link/v1/status.json"

配信 JSON の置き場所。

DEFAULT_POLLING_INTERVAL_S = 60

配信は 1 分ごとに更新される。それより短くしても変化に早く気付けない。

POLLING_INTERVAL_RANGE = 30..3600

Constructors

from_section(section : JSON::Any | Nil) : Settings
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

default_services
Source
validate(section : JSON::Any | Nil) : Array(String)

設定 GUI と起動時の検証で使う。エラーメッセージの配列を返し、空なら妥当とみなす。

Source

Instance methods

enabled
Source
enabled=(enabled : Bool)
Source
feed_url

設定ファイルにだけ持ち、画面には出さない。 dev 環境や手元のサーバへ向けて動作を確かめるための項目である。

Source
feed_url=(feed_url : String)

設定ファイルにだけ持ち、画面には出さない。 dev 環境や手元のサーバへ向けて動作を確かめるための項目である。

Source
polling_interval_s
Source
polling_interval_s=(polling_interval_s : Int32)
Source
service_enabled?(id : String) : Bool
Source
services

サービスごとの有効と無効。書かれていない id は無効として扱う。 配信側にサービスが増えても、黙って通知が増えないためである。

Source
services=(services : Hash(String, Bool))

サービスごとの有効と無効。書かれていない id は無効として扱う。 配信側にサービスが増えても、黙って通知が増えないためである。

Source