Class: Drift::StaticModel
- Inherits:
-
Object
- Object
- Drift::StaticModel
- Defined in:
- lib/drift/static_model.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.source ⇒ Object
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ StaticModel
constructor
A new instance of StaticModel.
Constructor Details
#initialize(args = {}) ⇒ StaticModel
Returns a new instance of StaticModel.
57 58 59 60 61 |
# File 'lib/drift/static_model.rb', line 57 def initialize(args = {}) args.each do |k, v| instance_variable_set("@#{k.to_s.underscore}", v) unless v.nil? end end |
Class Attribute Details
.source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/drift/static_model.rb', line 4 def source @source end |
Class Method Details
.all ⇒ Object
6 7 8 |
# File 'lib/drift/static_model.rb', line 6 def all source.present? ? fetch_all : [] end |
.all_files ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/drift/static_model.rb', line 10 def all_files all_files = [] for_each_file do |file| all_files.push file end all_files end |
.find_by_file(file) ⇒ Object
20 21 22 |
# File 'lib/drift/static_model.rb', line 20 def find_by_file(file) build_from_file(file) end |