Class: FactoryTrace::Structures::Trait
- Inherits:
-
Object
- Object
- FactoryTrace::Structures::Trait
- Includes:
- Helpers::Statusable
- Defined in:
- lib/factory_trace/structures/trait.rb
Constant Summary
Constants included from Helpers::Statusable
Helpers::Statusable::PRIORITY_ORDER
Instance Attribute Summary collapse
-
#declaration_names ⇒ Object
readonly
Returns the value of attribute declaration_names.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from Helpers::Statusable
Instance Method Summary collapse
- #==(trait) ⇒ Boolean
-
#initialize(name, declaration_names: []) ⇒ Trait
constructor
A new instance of Trait.
- #to_h ⇒ Hash<Symbol, Object>
Methods included from Helpers::Statusable
Constructor Details
#initialize(name, declaration_names: []) ⇒ Trait
Returns a new instance of Trait.
10 11 12 13 |
# File 'lib/factory_trace/structures/trait.rb', line 10 def initialize(name, declaration_names: []) @name = name @declaration_names = declaration_names end |
Instance Attribute Details
#declaration_names ⇒ Object (readonly)
Returns the value of attribute declaration_names.
6 7 8 |
# File 'lib/factory_trace/structures/trait.rb', line 6 def declaration_names @declaration_names end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/factory_trace/structures/trait.rb', line 6 def name @name end |
Instance Method Details
#==(trait) ⇒ Boolean
24 25 26 27 28 |
# File 'lib/factory_trace/structures/trait.rb', line 24 def ==(trait) return false unless trait.is_a?(FactoryTrace::Structures::Trait) name == trait.name && declaration_names == trait.declaration_names end |
#to_h ⇒ Hash<Symbol, Object>
16 17 18 19 20 21 |
# File 'lib/factory_trace/structures/trait.rb', line 16 def to_h { name: name, declaration_names: declaration_names } end |