Class: ActiveYaml::Base
- Inherits:
-
ActiveFile::Base
- Object
- ActiveHash::Base
- ActiveFile::Base
- ActiveYaml::Base
- Extended by:
- ActiveFile::HashAndArrayFiles
- Defined in:
- lib/active_yaml/base.rb
Constant Summary collapse
- @@process_erb =
true
Class Method Summary collapse
Methods included from ActiveFile::HashAndArrayFiles
Methods inherited from ActiveFile::Base
actual_root_path, all_in_process, delete_all, full_path, reload, set_filename, set_root_path
Methods included from ActiveFile::MultipleFiles
full_paths, #multiple_files?, multiple_files?, set_filenames, #use_multiple_files
Methods inherited from ActiveHash::Base
#[], #[]=, #_read_attribute, add_default_value, add_to_record_index, all, all_in_process, #attributes, auto_assign_fields, base_class, cache_key, #cache_key, composite_primary_key?, compute_type, configuration_for_custom_finder, create, create!, data, data=, define_custom_find_all_method, define_custom_find_method, define_getter_method, define_interrogator_method, define_setter_method, delete_all, #destroyed?, empty?, #eql?, #errors, exists?, field, field_names, fields, has_query_constraints?, #hash, #id, #id=, #initialize, insert, mark_clean, mark_dirty, #marked_for_destruction?, method_missing, #new_record?, next_id, #persisted?, pluralize_table_names, polymorphic_name, primary_key, #readonly?, record_index, reload, reset_record_index, respond_to?, #save, scope, the_meta_class, #to_param, transaction, #valid?, validate_field, validate_unique_id
Constructor Details
This class inherits a constructor from ActiveHash::Base
Class Method Details
.extension ⇒ Object
20 21 22 |
# File 'lib/active_yaml/base.rb', line 20 def extension "yml" end |
.load_file ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/active_yaml/base.rb', line 12 def load_file if (data = raw_data).is_a?(Array) data elsif data.respond_to?(:values) data.map{ |key, value| {"key" => key}.merge(value) } end end |