Class: BruteSquad::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/brute_squad/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_name, options = {}) ⇒ Model

Configure a new model for use with BruteSquad

Accepts the following options:

:singular

Singular name for the model

:class_name

Class name of the model to use



11
12
13
14
15
# File 'lib/brute_squad/model.rb', line 11

def initialize(model_name, options = {})
  @name       = model_name
  @singular   = options[:singular] if options[:singular].present?
  @class_name = options[:class_name] if options[:class_name].present?
end

Instance Attribute Details

#class_name(value = nil) ⇒ Object

Returns the value of attribute class_name.



4
5
6
# File 'lib/brute_squad/model.rb', line 4

def class_name
  @class_name
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/brute_squad/model.rb', line 3

def name
  @name
end

#singular(value = nil) ⇒ Object

Returns the value of attribute singular.



4
5
6
# File 'lib/brute_squad/model.rb', line 4

def singular
  @singular
end