module Photish::Plugin::Core::Metadatable

Public Class Methods

is_for?(type) click to toggle source
# File lib/photish/plugin/core/metadatable.rb, line 5
def self.is_for?(type)
  [
    Photish::Plugin::Type::Collection,
    Photish::Plugin::Type::Album,
    Photish::Plugin::Type::Photo,
    Photish::Plugin::Type::Page,
  ].include?(type)
end

Public Instance Methods

metadata() click to toggle source
# File lib/photish/plugin/core/metadatable.rb, line 14
def metadata
  return unless File.exist?(metadata_file)
  @metadata ||= RecursiveOpenStruct.new(YAML.load_file(metadata_file))
end

Private Instance Methods

metadata_file() click to toggle source
# File lib/photish/plugin/core/metadatable.rb, line 21
def metadata_file
  File.join(dirname, basename_without_extension + '.yml')
end