Class: ActiveRecord::DataIntegrity::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/data_integrity/options.rb

Overview

Options parser

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Options

Returns a new instance of Options.



9
10
11
12
13
# File 'lib/active_record/data_integrity/options.rb', line 9

def initialize(options)
  @options = {
    only: options.only? ? options[:only].to_s.split(',') : nil
  }
end

Instance Method Details

#onlyObject



15
16
17
# File 'lib/active_record/data_integrity/options.rb', line 15

def only
  @options[:only] || []
end