Module: RailsAssist::Artifact::Files::Helper

Defined in:
lib/rails_assist/artifact/files.rb

Class Method Summary collapse

Class Method Details

.get_view_args(args) ⇒ Object Also known as: get_asset_args



108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/rails_assist/artifact/files.rb', line 108

def get_view_args args
  args = args.flatten
  first_arg = args.first
  case first_arg
  when Regexp
    expr = first_arg
  when String, Symbol
    _model = first_arg
  end
  expr = args[1] if args.size > 1 && args[1].kind_of?(Regexp)
  [expr, _model]
end