Class: Angus::SDoc::Definitions::GlossaryTerm
- Inherits:
-
Struct
- Object
- Struct
- Angus::SDoc::Definitions::GlossaryTerm
- Defined in:
- lib/angus/definitions/glossary_term.rb
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the glossary term.
-
#long_name ⇒ String
The long name of the glossary term.
-
#short_name ⇒ String
The short name of the glossary term.
Class Method Summary collapse
-
.build_from_hash(hash = {}) ⇒ Array<GlossaryTerm>
Initialize multiple GlossaryTerm using the information in the hash parameter.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
Instance Attribute Details
#description ⇒ String
The description of the glossary term.
6 7 8 |
# File 'lib/angus/definitions/glossary_term.rb', line 6 def description @description end |
#long_name ⇒ String
The long name of the glossary term.
6 7 8 |
# File 'lib/angus/definitions/glossary_term.rb', line 6 def long_name @long_name end |
#short_name ⇒ String
The short name of the glossary term.
6 7 8 |
# File 'lib/angus/definitions/glossary_term.rb', line 6 def short_name @short_name end |
Class Method Details
.build_from_hash(hash = {}) ⇒ Array<GlossaryTerm>
Initialize multiple GlossaryTerm using the information in the hash parameter.
16 17 18 19 20 |
# File 'lib/angus/definitions/glossary_term.rb', line 16 def build_from_hash(hash = {}) hash.map do |sort_name, gt| self.new(sort_name, gt['long_name'], gt['description']) end end |
Instance Method Details
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
29 30 31 32 33 |
# File 'lib/angus/definitions/glossary_term.rb', line 29 def ==(other) other.kind_of?(Definitions::GlossaryTerm) && self.short_name == other.short_name && self.long_name == other.long_name && self.description == other.description end |