Class: ROM::ModelBuilder

Inherits:
Object
  • Object
show all
Defined in:
core/lib/rom/model_builder.rb

Overview

Model builders can be used to build model classes for mappers

This is used when you define a mapper and setup a model using :name option.

Examples:

# this will define User model for you
class UserMapper < ROM::Mapper
  model name: 'User'
  attribute :id
  attribute :name
end

Direct Known Subclasses

PORO

Defined Under Namespace

Classes: PORO

Instance Attribute Summary collapse

Instance Attribute Details

#const_nameObject (readonly)

Returns the value of attribute const_name.



22
23
24
# File 'core/lib/rom/model_builder.rb', line 22

def const_name
  @const_name
end

#klassObject (readonly)

Returns the value of attribute klass.



22
23
24
# File 'core/lib/rom/model_builder.rb', line 22

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'core/lib/rom/model_builder.rb', line 20

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



22
23
24
# File 'core/lib/rom/model_builder.rb', line 22

def namespace
  @namespace
end