class Spooky::Post

Constants

ATTRIBUTES

Public Instance Methods

parse_attributes(attrs) click to toggle source
# File lib/spooky/post.rb, line 42
def parse_attributes(attrs)
  author = attrs["primary_author"]
  @primary_author = author.present? && Spooky::Author.new(author)

  @authors = (attrs["authors"] || []).map do |author|
    Spooky::Author.new(author)
  end

  tag = attrs["primary_tag"]
  @primary_tag = tag.present? && Spooky::Tag.new(tag)

  @tags = (attrs["tags"] || []).map do |tag|
    Spooky::Tag.new(tag)
  end
end