Class: Arborist::Migration::ModelArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/arborist/migration/model_arguments.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ModelArguments

Returns a new instance of ModelArguments.



4
5
6
7
8
9
# File 'lib/arborist/migration/model_arguments.rb', line 4

def initialize args
  options = args.extract_options!

  @model_ref   = args.first || model_from_options(options)
  @method_name = options.fetch :as, config.default_method_name
end

Instance Attribute Details

#method_nameObject (readonly)

Returns the value of attribute method_name.



2
3
4
# File 'lib/arborist/migration/model_arguments.rb', line 2

def method_name
  @method_name
end

#model_refObject (readonly)

Returns the value of attribute model_ref.



2
3
4
# File 'lib/arborist/migration/model_arguments.rb', line 2

def model_ref
  @model_ref
end