Module: Exegesis::Document::ClassMethods
- Defined in:
- lib/exegesis/document.rb
Instance Method Summary collapse
Instance Method Details
#timestamps! ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/exegesis/document.rb', line 12 def define_method :set_timestamps do @attributes['updated_at'] = Time.now @attributes['created_at'] ||= Time.now end expose 'updated_at', :as => Time, :writer => false expose 'created_at', :as => Time, :writer => false end |
#unique_id(meth = nil, &block) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/exegesis/document.rb', line 21 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 |