Module: Machinery::Scope
- Defined in:
- lib/scope.rb
Instance Attribute Summary collapse
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#scope_file_store ⇒ Object
Returns the value of attribute scope_file_store.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#meta ⇒ Object
Returns the value of attribute meta.
43 44 45 |
# File 'lib/scope.rb', line 43 def @meta end |
#scope_file_store ⇒ Object
Returns the value of attribute scope_file_store.
44 45 46 |
# File 'lib/scope.rb', line 44 def scope_file_store @scope_file_store end |
Class Method Details
.all_scopes ⇒ Object
25 26 27 |
# File 'lib/scope.rb', line 25 def self.all_scopes @scopes end |
.for(scope_name, json, scope_file_store) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/scope.rb', line 29 def self.for(scope_name, json, scope_file_store) all_scopes.each do |scope| if scope.new.scope_name == scope_name scope = scope.from_json(json) scope.scope_file_store = scope_file_store scope.scope = scope return scope end end nil end |
.included(mod) ⇒ Object
20 21 22 23 |
# File 'lib/scope.rb', line 20 def self.included(mod) @scopes ||= [] @scopes.push(mod) end |
Instance Method Details
#is_extractable? ⇒ Boolean
58 59 60 |
# File 'lib/scope.rb', line 58 def is_extractable? SystemDescription::EXTRACTABLE_SCOPES.include?(self.scope_name) end |
#scope_name ⇒ Object
53 54 55 56 |
# File 'lib/scope.rb', line 53 def scope_name scope = self.class.name.match(/^(.*)Scope$/)[1] scope.gsub(/([^A-Z])([A-Z])/, "\\1_\\2").downcase end |