Class: Relation
- Inherits:
-
Object
- Object
- Relation
- Defined in:
- lib/redisant/relations.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(name, object) ⇒ Relation
constructor
A new instance of Relation.
- #object_class ⇒ Object
Constructor Details
#initialize(name, object) ⇒ Relation
Returns a new instance of Relation.
4 5 6 7 8 |
# File 'lib/redisant/relations.rb', line 4 def initialize name, object @name = name.to_s @object = object @class = Inflector.constantize Inflector.singularize(name) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/redisant/relations.rb', line 2 def name @name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
2 3 4 |
# File 'lib/redisant/relations.rb', line 2 def object @object end |
Instance Method Details
#object_class ⇒ Object
10 11 12 |
# File 'lib/redisant/relations.rb', line 10 def object_class @class end |