Class: CanTango::Loader::Yaml
- Inherits:
-
Object
- Object
- CanTango::Loader::Yaml
- Defined in:
- lib/cantango/loader/yaml.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_name) ⇒ Yaml
constructor
A new instance of Yaml.
- #parser ⇒ Object
- #yml_content ⇒ Object
Constructor Details
#initialize(file_name) ⇒ Yaml
Returns a new instance of Yaml.
6 7 8 |
# File 'lib/cantango/loader/yaml.rb', line 6 def initialize file_name @file_name = file_name end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
4 5 6 |
# File 'lib/cantango/loader/yaml.rb', line 4 def file_name @file_name end |
Class Method Details
.inherited(subclass) ⇒ Object
10 11 12 |
# File 'lib/cantango/loader/yaml.rb', line 10 def self.inherited subclass subclass.extend ClassMethods end |
Instance Method Details
#parser ⇒ Object
14 15 16 |
# File 'lib/cantango/loader/yaml.rb', line 14 def parser raise NotImplementedError end |
#yml_content ⇒ Object
18 19 20 21 22 |
# File 'lib/cantango/loader/yaml.rb', line 18 def yml_content YAML.load_file(file_name) rescue raise "Couldn't load YAML file: #{file_name}" end |