Class: Pinspec::Factory
- Inherits:
-
Data
- Object
- Data
- Pinspec::Factory
- Defined in:
- lib/pinspec/types.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#hazards ⇒ Object
readonly
Returns the value of attribute hazards.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#traits ⇒ Object
readonly
Returns the value of attribute traits.
Instance Method Summary collapse
- #associations ⇒ Object
- #attribute(name) ⇒ Object
- #fires_callbacks? ⇒ Boolean
- #persists? ⇒ Boolean
- #trait(name) ⇒ Object
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def aliases @aliases end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def attributes @attributes end |
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def callbacks @callbacks end |
#file ⇒ Object (readonly)
Returns the value of attribute file
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def file @file end |
#hazards ⇒ Object (readonly)
Returns the value of attribute hazards
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def hazards @hazards end |
#line ⇒ Object (readonly)
Returns the value of attribute line
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def line @line end |
#model ⇒ Object (readonly)
Returns the value of attribute model
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def parent @parent end |
#traits ⇒ Object (readonly)
Returns the value of attribute traits
329 330 331 |
# File 'lib/pinspec/types.rb', line 329 def traits @traits end |
Instance Method Details
#associations ⇒ Object
340 341 342 |
# File 'lib/pinspec/types.rb', line 340 def associations attributes.select(&:association?) end |
#attribute(name) ⇒ Object
332 333 334 |
# File 'lib/pinspec/types.rb', line 332 def attribute(name) attributes.find { |a| a.name == name.to_sym } end |
#fires_callbacks? ⇒ Boolean
348 349 350 |
# File 'lib/pinspec/types.rb', line 348 def fires_callbacks? !callbacks.empty? end |
#persists? ⇒ Boolean
344 345 346 |
# File 'lib/pinspec/types.rb', line 344 def persists? !hazards.map(&:first).include?(:skip_create) end |
#trait(name) ⇒ Object
336 337 338 |
# File 'lib/pinspec/types.rb', line 336 def trait(name) traits.find { |t| t.name == name.to_sym } end |