Class: Spectifly::Base::Association
- Inherits:
-
EntityNode
- Object
- EntityNode
- Spectifly::Base::Association
- Defined in:
- lib/spectifly/base/association.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#relationship ⇒ Object
readonly
Returns the value of attribute relationship.
Attributes inherited from EntityNode
#attributes, #description, #example, #inherits_from, #name, #restrictions, #validations
Instance Method Summary collapse
-
#initialize(field_name, options = {}) ⇒ Association
constructor
A new instance of Association.
- #multiple? ⇒ Boolean
Methods inherited from EntityNode
#display_type, #extract_attributes, #extract_restrictions, #required?, #type, #unique?
Constructor Details
#initialize(field_name, options = {}) ⇒ Association
Returns a new instance of Association.
8 9 10 11 |
# File 'lib/spectifly/base/association.rb', line 8 def initialize(field_name, = {}) super @relationship = .delete(:relationship) end |
Instance Attribute Details
#relationship ⇒ Object (readonly)
Returns the value of attribute relationship.
6 7 8 |
# File 'lib/spectifly/base/association.rb', line 6 def relationship @relationship end |
Instance Method Details
#multiple? ⇒ Boolean
13 14 15 |
# File 'lib/spectifly/base/association.rb', line 13 def multiple? ['has_many', 'has_many_and_belongs_to', 'belongs_to_many'].include? relationship end |