Class: GhostRb::Controllers::PostsController

Inherits:
BaseController show all
Defined in:
lib/ghost_rb/controllers/posts_controller.rb

Overview

Author:

  • Rene Hernandez

Since:

  • 0.2

Instance Attribute Summary collapse

Attributes inherited from BaseController

#client, #params

Instance Method Summary collapse

Methods inherited from BaseController

#all, #fields, #filter, #find_by, #include, #limit, #order, #page, #where

Constructor Details

#initialize(client, params = nil) ⇒ PostsController

Returns a new instance of PostsController.

Since:

  • 0.2



10
11
12
13
14
# File 'lib/ghost_rb/controllers/posts_controller.rb', line 10

def initialize(client, params = nil)
  super
  @endpoint = 'posts'
  @resource_klass = Resources::Post
end

Instance Attribute Details

#endpointObject (readonly)

Since:

  • 0.2



8
9
10
# File 'lib/ghost_rb/controllers/posts_controller.rb', line 8

def endpoint
  @endpoint
end

#resource_klassObject (readonly)

Since:

  • 0.2



8
9
10
# File 'lib/ghost_rb/controllers/posts_controller.rb', line 8

def resource_klass
  @resource_klass
end

Instance Method Details

#formats(formats) ⇒ Object

Since:

  • 0.2



16
17
18
# File 'lib/ghost_rb/controllers/posts_controller.rb', line 16

def formats(formats)
  where(formats: formats)
end