Module: Exegesis::Document::ClassMethods
- Defined in:
- lib/exegesis/document.rb
Instance Method Summary collapse
Instance Method Details
#timestamps! ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/exegesis/document.rb', line 17 def define_method :set_timestamps do @attributes['updated_at'] = Time.now @attributes['created_at'] ||= Time.now end expose 'updated_at', :as => Time expose 'created_at', :as => Time end |
#unique_id(meth = nil, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/exegesis/document.rb', line 26 def unique_id meth=nil, &block if block @unique_id_method = block elsif meth @unique_id_method = meth else @unique_id_method ||= nil end end |