Class: FactoryTrace::Structures::Trait
- Inherits:
-
Object
- Object
- FactoryTrace::Structures::Trait
- Defined in:
- lib/factory_trace/structures/trait.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner_name ⇒ Object
readonly
Returns the value of attribute owner_name.
Instance Method Summary collapse
- #==(trait) ⇒ Boolean
-
#initialize(name, owner_name) ⇒ Trait
constructor
A new instance of Trait.
- #to_h ⇒ Hash<Symbol, String>
Constructor Details
#initialize(name, owner_name) ⇒ Trait
Returns a new instance of Trait.
8 9 10 11 |
# File 'lib/factory_trace/structures/trait.rb', line 8 def initialize(name, owner_name) @name = name @owner_name = owner_name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/factory_trace/structures/trait.rb', line 4 def name @name end |
#owner_name ⇒ Object (readonly)
Returns the value of attribute owner_name.
4 5 6 |
# File 'lib/factory_trace/structures/trait.rb', line 4 def owner_name @owner_name end |
Instance Method Details
#==(trait) ⇒ Boolean
22 23 24 25 26 |
# File 'lib/factory_trace/structures/trait.rb', line 22 def ==(trait) return false unless trait.is_a?(FactoryTrace::Structures::Trait) name == trait.name && owner_name == trait.owner_name end |
#to_h ⇒ Hash<Symbol, String>
14 15 16 17 18 19 |
# File 'lib/factory_trace/structures/trait.rb', line 14 def to_h { name: name, owner_name: owner_name } end |