module PoetFrostConfig

Configuration module for use when poet_frost_API is called with include.

Include PoetFrostAPI and map the API fields to attributes of the local object. In the example below, the content field is mapped to the local object's body attribute.

Usage example: include PoetFrostAPI

poet_frost_configure do |config|

config.name = :name # Required
config.datePublished = :updated_at
config.dateCreated = :created_at
config.author = :author # Required
config.tags = :tags
config.content = :body # Required
config.work_id = :workid
config.api_key = :frost_api_key

end

API keys currently need to be manually registered at frost.po.et/

In a Rails model like a blog post, you'll want to have :frost_api_key be a linked attribute belonging to the user making the post, unless it's a single user blog, in which case it might be easier to just set the FROST_TOKEN environment variable.

Constants

FROST_API_KEY
FROST_HTTP
FROST_URI

Attributes

poet_frost_config[RW]

Public Instance Methods

poet_frost_configuration() click to toggle source
# File lib/poet_frost_API.rb, line 39
def poet_frost_configuration
  @poet_frost_config ||= OpenStruct.new(
    name: nil,
    datePublished: nil,
    dateCreated: nil,
    author: nil,
    tags: nil,
    content: nil,
    api_key: nil,
    work_id: nil
  )
end
poet_frost_configure() { |poet_frost_configuration| ... } click to toggle source
# File lib/poet_frost_API.rb, line 52
def poet_frost_configure
  yield(poet_frost_configuration)
end