Class: Mongoid::History::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid/history/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/mongoid/history/options.rb', line 4

def options
  @options
end

#trackableObject (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 = {})
  @options = default_options.merge(options)
  prepare_skipped_fields
  prepare_formatted_fields
  parse_tracked_fields_and_relations
  @options
end

#scopeObject



10
11
12
# File 'lib/mongoid/history/options.rb', line 10

def scope
  trackable.collection_name.to_s.singularize.to_sym
end