Class: Yuzu::Core::FileProperties
- Defined in:
- lib/yuzu/core/website_file.rb
Overview
FileProperties objects are passed into renderers when they need to pass information to a Haml template or other user-facing mechanism. e.g. This makes “breadcrumb” available in Haml templates and layouts by using post.breadcrumb.
Instance Method Summary collapse
-
#initialize(website_file) ⇒ FileProperties
constructor
instance.methods == public instance methods.
-
#to_s ⇒ Object
initialize.
Constructor Details
#initialize(website_file) ⇒ FileProperties
instance.methods == public instance methods
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/yuzu/core/website_file.rb', line 247 def initialize(website_file) @website_file = website_file unique_methods = (website_file.methods - Object.instance_methods).sort (class << self; self; end).class_eval do unique_methods.each do |method_name| define_method(method_name) do website_file.send(method_name) end end end # class_eval end |
Instance Method Details
#to_s ⇒ Object
initialize
265 266 267 |
# File 'lib/yuzu/core/website_file.rb', line 265 def to_s "Properties(#{@website_file.path.relative})" end |