Class: BruteSquad::Model
- Inherits:
-
Object
- Object
- BruteSquad::Model
- Defined in:
- lib/brute_squad/model.rb
Instance Attribute Summary collapse
-
#class_name(value = nil) ⇒ Object
Returns the value of attribute class_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#singular(value = nil) ⇒ Object
Returns the value of attribute singular.
Instance Method Summary collapse
-
#initialize(model_name, options = {}) ⇒ Model
constructor
Configure a new model for use with BruteSquad.
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, = {}) @name = model_name @singular = [:singular] if [:singular].present? @class_name = [:class_name] if [: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 |
#name ⇒ Object (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 |