Module: Ronin::Script::ClassMethods
- Defined in:
- lib/ronin/script/script.rb
Overview
Instance Method Summary collapse
-
#load_all(attributes = {}) ⇒ Object
Loads all objects with the matching attributes.
-
#load_first(attributes = {}) ⇒ Cacheable
Loads the first object with matching attributes.
-
#load_from(path) ⇒ Script
Loads the Ronin::Script of the same class.
Instance Method Details
#load_all(attributes = {}) ⇒ Object
Loads all objects with the matching attributes.
124 125 126 127 128 129 |
# File 'lib/ronin/script/script.rb', line 124 def load_all(attributes={}) resources = all(attributes) resources.each { |resource| resource.load_script! } return resources end |
#load_first(attributes = {}) ⇒ Cacheable
Loads the first object with matching attributes.
144 145 146 147 148 149 150 |
# File 'lib/ronin/script/script.rb', line 144 def load_first(attributes={}) if (resource = first(attributes)) resource.load_script! end return resource end |
#load_from(path) ⇒ Script
Loads the Ronin::Script of the same class.
110 111 112 |
# File 'lib/ronin/script/script.rb', line 110 def load_from(path) load_object(path) end |