Class: RocketChat::Messages::Settings
- Inherits:
-
Object
- Object
- RocketChat::Messages::Settings
- Defined in:
- lib/rocket_chat/messages/settings.rb
Overview
Rocket.Chat Settings messages
Instance Method Summary collapse
-
#[](id) ⇒ various
settings get REST API.
- #[]=(id, value) ⇒ Object
-
#initialize(session) ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize(session) ⇒ Settings
Returns a new instance of Settings.
12 13 14 |
# File 'lib/rocket_chat/messages/settings.rb', line 12 def initialize(session) @session = session end |
Instance Method Details
#[](id) ⇒ various
settings get REST API
22 23 24 25 26 27 28 |
# File 'lib/rocket_chat/messages/settings.rb', line 22 def [](id) response = session.request_json( "/api/v1/settings/#{id}" ) response['value'] if response['success'] end |
#[]=(id, value) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rocket_chat/messages/settings.rb', line 30 def []=(id, value) response = session.request_json( "/api/v1/settings/#{id}", method: :post, body: { value: value } ) value if response['success'] # rubocop:disable Lint/Void end |