Class: Gitter::API::Base
- Inherits:
-
Object
- Object
- Gitter::API::Base
- Defined in:
- lib/gitter/api/base.rb
Overview
Base model that other Gitter::API models inherit from
See:
-
Gitter::API::Message -
Gitter::API::Room -
Gitter::API::User
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Configured client that fetched the record.
Instance Method Summary collapse
-
#api_prefix ⇒ Object
Helper method for fetching the API prefix from the client.
-
#initialize(client, data) ⇒ Base
constructor
All models should call this in their overrides, and configure their specific model attributes in the override from the @data that was passed in.
Constructor Details
#initialize(client, data) ⇒ Base
All models should call this in their overrides, and configure their specific model attributes in the override from the @data that was passed in.
Note: @data is set, but is not a formal accessor. Currently just available for debugging if needed.
25 26 27 28 |
# File 'lib/gitter/api/base.rb', line 25 def initialize client, data # :nodoc: @client = client @data = data end |
Instance Attribute Details
#client ⇒ Object (readonly)
Configured client that fetched the record
Used for subsequent calls (instance methods)
16 17 18 |
# File 'lib/gitter/api/base.rb', line 16 def client @client end |
Instance Method Details
#api_prefix ⇒ Object
Helper method for fetching the API prefix from the client
32 33 34 |
# File 'lib/gitter/api/base.rb', line 32 def api_prefix client.api_prefix end |