class Feedbook::Post
Attributes
feed_title[R]
published[R]
title[R]
url[R]
Public Class Methods
new(opts = {})
click to toggle source
Initializes new Post
from opts Hash @param opts = {} [Hash] Hash with params required for Post
creation
@return [NilClass] nil
# File lib/feedbook/post.rb, line 10 def initialize(opts = {}) @author = opts.fetch(:author) @published = opts.fetch(:published) @url = opts.fetch(:url) @title = opts.fetch(:title) @feed_title = opts.fetch(:feed_title) end
Public Instance Methods
to_hash()
click to toggle source
Returns hash with values from posts.
@return [Hash] Hash with post variables
# File lib/feedbook/post.rb, line 21 def to_hash { 'author' => author, 'published' => published, 'url' => url, 'title' => title, 'feed_title' => feed_title } end
Also aliased as: to_h