Class: Spotlight::PageContent::SirTrevor

Inherits:
Object
  • Object
show all
Defined in:
app/models/spotlight/page_content/sir_trevor.rb

Overview

Sir-Trevor created content

Class Method Summary collapse

Class Method Details

.parse(page, attribute) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/models/spotlight/page_content/sir_trevor.rb', line 7

def self.parse(page, attribute)
  content = page.read_attribute(attribute)
  content ||= [].to_json

  return SirTrevorRails::BlockArray.new if content.blank?

  SirTrevorRails::BlockArray.from_json(content, page)
end