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.
4 5 6 7 8 |
# File 'lib/drift/static_model.rb', line 4 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.
12 13 14 |
# File 'lib/drift/static_model.rb', line 12 def source @source end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/drift/static_model.rb', line 14 def all source.present? ? fetch_all : [] end |
.all_files ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/drift/static_model.rb', line 18 def all_files all_files = [] for_each_file do |file| all_files.push file end all_files end |
.find_by_file(file) ⇒ Object
28 29 30 |
# File 'lib/drift/static_model.rb', line 28 def find_by_file(file) build_from_file(file) end |