class GhostRb::Controllers::TagsController

@author Rene Hernandez @since 0.2

Attributes

endpoint[R]
resource_klass[R]

Public Class Methods

new(client, params = nil) click to toggle source
# File lib/ghost_rb/controllers/tags_controller.rb, line 10
def initialize(client, params = nil)
  super
  @endpoint = 'tags'
  @resource_klass = Resources::Tag
end

Private Instance Methods

raise_fetch_list_error(status, errors) click to toggle source
# File lib/ghost_rb/controllers/tags_controller.rb, line 26
def raise_fetch_list_error(status, errors)
  raise Errors::RequestError.new('Unable to fetch tags',
                                 status,
                                 errors)
end
raise_fetch_single_error(kvp, status, errors) click to toggle source
# File lib/ghost_rb/controllers/tags_controller.rb, line 18
def raise_fetch_single_error(kvp, status, errors)
  key = kvp.key?(:id) ? :id : :slug
  message = "Unable to fetch tag with #{key} = #{kvp[key]}"
  raise Errors::RequestError.new(message,
                                 status,
                                 errors)
end