Class: PluginManager::Dependency
- Inherits:
-
Object
- Object
- PluginManager::Dependency
- Defined in:
- lib/plugin_manager.rb
Instance Attribute Summary collapse
-
#required_name ⇒ Object
readonly
Returns the value of attribute required_name.
-
#required_version ⇒ Object
readonly
Returns the value of attribute required_version.
Instance Method Summary collapse
-
#initialize(plugin_manager, required_name, required_version) ⇒ Dependency
constructor
A new instance of Dependency.
- #inspect ⇒ Object
- #satisfied? ⇒ Boolean
Constructor Details
#initialize(plugin_manager, required_name, required_version) ⇒ Dependency
Returns a new instance of Dependency.
67 68 69 70 71 |
# File 'lib/plugin_manager.rb', line 67 def initialize(plugin_manager, required_name, required_version) @plugin_manager = plugin_manager @required_name = required_name @required_version = required_version end |
Instance Attribute Details
#required_name ⇒ Object (readonly)
Returns the value of attribute required_name.
64 65 66 |
# File 'lib/plugin_manager.rb', line 64 def required_name @required_name end |
#required_version ⇒ Object (readonly)
Returns the value of attribute required_version.
65 66 67 |
# File 'lib/plugin_manager.rb', line 65 def required_version @required_version end |
Instance Method Details
#inspect ⇒ Object
79 80 81 |
# File 'lib/plugin_manager.rb', line 79 def inspect "dep(#{required_name} #{required_version})" end |
#satisfied? ⇒ Boolean
73 74 75 76 77 |
# File 'lib/plugin_manager.rb', line 73 def satisfied? if loaded_plugin = @plugin_manager.loaded_plugins.detect {|pl| pl.name == required_name } PluginManager.compare_version(required_version, loaded_plugin.version) end end |