Module: Ronin::Model::HasTitle

Defined in:
lib/ronin/model/has_title.rb

Overview

Adds a title property to a model.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Adds the title property and ClassMethods to the model.

Parameters:

  • base (Class)

    The model.



36
37
38
39
40
41
42
43
44
# File 'lib/ronin/model/has_title.rb', line 36

def self.included(base)
  base.send :include, Model
  base.send :extend, ClassMethods

  base.module_eval do
    # The title of the model
    property :title, String
  end
end