Module: Machinery::ScopeMixin

Defined in:
lib/scope_mixin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



20
21
22
# File 'lib/scope_mixin.rb', line 20

def meta
  @meta
end

Instance Method Details

#is_extractable?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/scope_mixin.rb', line 34

def is_extractable?
  SystemDescription::EXTRACTABLE_SCOPES.include?(self.scope_name)
end

#scope_nameObject



29
30
31
32
# File 'lib/scope_mixin.rb', line 29

def scope_name
  scope = self.class.name.match(/^(.*)Scope$/)[1]
  scope.gsub(/([^A-Z])([A-Z])/, "\\1_\\2").downcase
end

#set_metadata(timestring, host) ⇒ Object



22
23
24
25
26
27
# File 'lib/scope_mixin.rb', line 22

def (timestring, host)
  self.meta = Machinery::Object.new(
    modified: timestring,
    hostname: host
  )
end