Class: Yarrow::Content::Resource

Inherits:
Schema::Entity show all
Defined in:
lib/yarrow/content/resource.rb

Class Method Summary collapse

Methods inherited from Schema::Entity

[], attribute, dictionary, inherited, #initialize, #merge, #to_h

Constructor Details

This class inherits a constructor from Yarrow::Schema::Entity

Class Method Details

.from_frontmatter_url(data, url_field) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/yarrow/content/resource.rb', line 10

def self.from_frontmatter_url(data, url_field)
  new({
    id: data[:id],
    name: data[:name],
    title: data[:title],
    content: data[:content],
    url: data[url_field]
  })
end

.from_source_path(data, &block) ⇒ Object



24
25
26
# File 'lib/yarrow/content/resource.rb', line 24

def self.from_source_path(data, &block)

end

.from_template_url(data, template, &block) ⇒ Object



20
21
22
# File 'lib/yarrow/content/resource.rb', line 20

def self.from_template_url(data, template, &block)

end