class OpenStax::Content::Fragment
All fragment subclasses must be serializable with to_yaml and YAML.load Nokogiri nodes are not serializable, so they must be processed in the initialize method
Attributes
labels[R]
node_id[R]
title[R]
Public Class Methods
new(node:, title: nil, labels: nil)
click to toggle source
# File lib/openstax/content/fragment.rb, line 6 def initialize(node:, title: nil, labels: nil) @title = title @labels = labels || [] @node_id = node[:id] end
Public Instance Methods
blank?()
click to toggle source
# File lib/openstax/content/fragment.rb, line 12 def blank? false end
html?()
click to toggle source
# File lib/openstax/content/fragment.rb, line 16 def html? false end