Module: Ronin::DB::Model::HasUniqueName::ClassMethods

Defined in:
lib/ronin/db/model/has_unique_name.rb

Overview

Class methods that will be added when Ronin::DB::Model::HasUniqueName is included.

Instance Method Summary collapse

Instance Method Details

#parse(name) ⇒ Model

Parses a unique name.

Parameters:

  • name (String)

    The name to parse.

Returns:

  • (Model)

    A new or previously saved resource.



73
74
75
# File 'lib/ronin/db/model/has_unique_name.rb', line 73

def parse(name)
  find_or_initialize_by(name: name.strip)
end