Class: Fortnox::Relation
- Inherits:
-
Object
- Object
- Fortnox::Relation
- Defined in:
- lib/fortnox/relation.rb
Instance Attribute Summary collapse
-
#class_override ⇒ Object
readonly
Returns the value of attribute class_override.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, class_override: nil) ⇒ Relation
constructor
A new instance of Relation.
- #relation_class ⇒ Object
Constructor Details
#initialize(name, type, class_override: nil) ⇒ Relation
Returns a new instance of Relation.
5 6 7 8 9 |
# File 'lib/fortnox/relation.rb', line 5 def initialize(name, type, class_override: nil) @name = name.to_s @type = type @class_override = class_override end |
Instance Attribute Details
#class_override ⇒ Object (readonly)
Returns the value of attribute class_override.
3 4 5 |
# File 'lib/fortnox/relation.rb', line 3 def class_override @class_override end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/fortnox/relation.rb', line 3 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/fortnox/relation.rb', line 3 def type @type end |
Instance Method Details
#relation_class ⇒ Object
11 12 13 |
# File 'lib/fortnox/relation.rb', line 11 def relation_class "Fortnox::#{class_override || name.classify}".constantize end |