Module: Shikimori::API::V1::Styles
- Included in:
- Shikimori::API::V1
- Defined in:
- lib/shikimori/api/v1/styles.rb
Overview
Methods for the Styles API
Instance Method Summary collapse
-
#create_style(style, headers: nil, **query) ⇒ Hash
Create style.
-
#preview_style(style, headers: nil, **query) ⇒ Hash
Preview style.
-
#style(id, headers: nil, **query) ⇒ Hash
Get a style.
-
#update_style(id, style, headers: nil, **query) ⇒ Hash
Update style.
Instance Method Details
#create_style(style, headers: nil, **query) ⇒ Hash
Create style
55 56 57 |
# File 'lib/shikimori/api/v1/styles.rb', line 55 def create_style(style, headers: nil, **query) rest.post base_url.join('styles').url, { style: style }, headers: headers, query: query end |
#preview_style(style, headers: nil, **query) ⇒ Hash
Preview style
106 107 108 |
# File 'lib/shikimori/api/v1/styles.rb', line 106 def preview_style(style, headers: nil, **query) rest.post base_url.join('styles', 'preview').url, { style: style }, headers: headers, query: query end |
#style(id, headers: nil, **query) ⇒ Hash
Get a style
26 27 28 |
# File 'lib/shikimori/api/v1/styles.rb', line 26 def style(id, headers: nil, **query) rest.get base_url.join('styles', id.to_s).url, headers: headers, query: query end |
#update_style(id, style, headers: nil, **query) ⇒ Hash
Update style
82 83 84 |
# File 'lib/shikimori/api/v1/styles.rb', line 82 def update_style(id, style, headers: nil, **query) rest.put base_url.join('styles', id.to_s).url, { style: style }, headers: headers, query: query end |