Class: MisarBlog::SeriesResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/misarblog/client.rb

Overview

── Resource: Series ─────────────────────────────────────────────────────────

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from MisarBlog::Resource

Instance Method Details

#add_article(slug, article_slug:, position: nil) ⇒ Object

POST /series/slug/articles — add an article to a series.



162
163
164
165
# File 'lib/misarblog/client.rb', line 162

def add_article(slug, article_slug:, position: nil)
  body = compact(article_slug: article_slug, position: position)
  @client.request(:post, "/series/#{escape(slug)}/articles", body)
end

#create(title:, description: nil) ⇒ Object

POST /series



156
157
158
159
# File 'lib/misarblog/client.rb', line 156

def create(title:, description: nil)
  body = compact(title: title, description: description)
  Models::Series.new(@client.request(:post, "/series", body))
end

#listObject

GET /series



151
152
153
# File 'lib/misarblog/client.rb', line 151

def list
  Models::SeriesList.new(@client.request(:get, "/series"))
end