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.
-
#definition_path ⇒ Object
readonly
Returns the value of attribute definition_path.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from Helpers::Statusable
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(name, declaration_names: [], definition_path: nil) ⇒ Trait
constructor
A new instance of Trait.
- #to_h ⇒ Hash<Symbol, Object>
Methods included from Helpers::Statusable
Constructor Details
#initialize(name, declaration_names: [], definition_path: nil) ⇒ Trait
Returns a new instance of Trait.
13 14 15 16 17 |
# File 'lib/factory_trace/structures/trait.rb', line 13 def initialize(name, declaration_names: [], definition_path: nil) @name = name @declaration_names = declaration_names @definition_path = definition_path end |
Instance Attribute Details
#declaration_names ⇒ Object (readonly)
Returns the value of attribute declaration_names.
8 9 10 |
# File 'lib/factory_trace/structures/trait.rb', line 8 def declaration_names @declaration_names end |
#definition_path ⇒ Object (readonly)
Returns the value of attribute definition_path.
8 9 10 |
# File 'lib/factory_trace/structures/trait.rb', line 8 def definition_path @definition_path end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/factory_trace/structures/trait.rb', line 8 def name @name end |
Instance Method Details
#==(other) ⇒ Boolean
29 30 31 32 33 |
# File 'lib/factory_trace/structures/trait.rb', line 29 def ==(other) return false unless other.is_a?(FactoryTrace::Structures::Trait) name == other.name && declaration_names == other.declaration_names && definition_path == other.definition_path end |
#to_h ⇒ Hash<Symbol, Object>
20 21 22 23 24 25 26 |
# File 'lib/factory_trace/structures/trait.rb', line 20 def to_h { name: name, declaration_names: declaration_names, definition_path: definition_path } end |