class Troy::Meta
Constants
- REGEX
Attributes
file[R]
Public Class Methods
new(file)
click to toggle source
# File lib/troy/meta.rb, line 12 def initialize(file) @file = file end
Public Instance Methods
content()
click to toggle source
# File lib/troy/meta.rb, line 16 def content @content ||= raw.gsub(REGEX, "") end
data()
click to toggle source
# File lib/troy/meta.rb, line 20 def data @data ||= raw =~ REGEX ? YAML.safe_load(raw[REGEX, 1], [Date, Time]) : {} end
method_missing(name, *_args)
click to toggle source
# File lib/troy/meta.rb, line 25 def method_missing(name, *_args) data[name.to_s] end
raw()
click to toggle source
# File lib/troy/meta.rb, line 33 def raw @raw ||= File.read(file) end
respond_to_missing?(_method, _include_private = false)
click to toggle source
# File lib/troy/meta.rb, line 29 def respond_to_missing?(_method, _include_private = false) true end