Class: EhbrsRubyUtils::Music::Ous::Node
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Music::Ous::Node
- Defined in:
- lib/ehbrs_ruby_utils/music/ous/node.rb
Constant Summary collapse
- DEFAULT_LANGUAGE =
'unk'
- LANGUAGE_FILE_BASENAME =
'.language'
Instance Method Summary collapse
- #language ⇒ Object
- #language_file ⇒ Object
- #name ⇒ Object
- #parent_language ⇒ Object
- #real_path ⇒ Object
- #self_language ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#language ⇒ Object
21 22 23 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 21 def language self_language || parent_language || DEFAULT_LANGUAGE end |
#language_file ⇒ Object
25 26 27 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 25 def language_file path.join(LANGUAGE_FILE_BASENAME) end |
#name ⇒ Object
17 18 19 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 17 def name real_path.basename.to_s end |
#parent_language ⇒ Object
29 30 31 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 29 def parent_language parent_node.if_present(&:language) end |
#real_path ⇒ Object
33 34 35 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 33 def real_path path.readlink_r end |
#self_language ⇒ Object
37 38 39 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 37 def self_language language_file.if_exist('', &:read).strip.presence end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/ehbrs_ruby_utils/music/ous/node.rb', line 41 def to_s name end |