Sha256: a4cc38a206f3e49a07a5ee3f670fb309fcee035cca102b2eb8e202b881062ba5
Contents?: true
Size: 739 Bytes
Versions: 14
Compression:
Stored size: 739 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'eac_ruby_utils/yaml' module EhbrsRubyUtils module CookingBook class Recipe enable_simple_cache require_sub __FILE__ class << self def from_file(path) new(::EacRubyUtils::Yaml.load_file(path)) end end common_constructor :source_data do self.source_data = source_data.deep_symbolize_keys end def title source_data.fetch(:title) end def notes source_data[:notes] end def parts @parts ||= source_data.fetch(:parts).map do |k, v| ::EhbrsRubyUtils::CookingBook::Recipe::Part.new(k, v) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems