Class: Mongoid::History::Options
- Inherits:
-
Object
- Object
- Mongoid::History::Options
- Defined in:
- lib/mongoid/history/options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#trackable ⇒ Object
readonly
Returns the value of attribute trackable.
Instance Method Summary collapse
-
#initialize(trackable) ⇒ Options
constructor
A new instance of Options.
- #parse(options = {}) ⇒ Object
- #scope ⇒ Object
Constructor Details
#initialize(trackable) ⇒ Options
Returns a new instance of Options.
6 7 8 |
# File 'lib/mongoid/history/options.rb', line 6 def initialize(trackable) @trackable = trackable end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/mongoid/history/options.rb', line 4 def @options end |
#trackable ⇒ Object (readonly)
Returns the value of attribute trackable.
4 5 6 |
# File 'lib/mongoid/history/options.rb', line 4 def trackable @trackable end |
Instance Method Details
#parse(options = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/mongoid/history/options.rb', line 14 def parse( = {}) @options = .merge() prepare_skipped_fields prepare_formatted_fields parse_tracked_fields_and_relations @options end |
#scope ⇒ Object
10 11 12 |
# File 'lib/mongoid/history/options.rb', line 10 def scope trackable.collection_name.to_s.singularize.to_sym end |