Module: Brief::Model::AccessorMethods
- Defined in:
- lib/brief/model.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/brief/model.rb', line 44
def method_missing(meth, *args, &block)
if args.empty?
if document.respond_to?(meth)
document.send(meth)
else
document.data && document.data.key?(meth) ? data[meth] : .send(meth)
end
else
super
end
end
|
Instance Method Details
#content ⇒ Object
36
37
38
|
# File 'lib/brief/model.rb', line 36
def content
document.content
end
|
#data ⇒ Object
32
33
34
|
# File 'lib/brief/model.rb', line 32
def data
document.data || {}.to_mash
end
|
#exists? ⇒ Boolean
56
57
58
|
# File 'lib/brief/model.rb', line 56
def exists?
document && document.path && document.path.exist?
end
|