Module: Kanrisuru::OsPackage::Define
- Included in:
- Core::Apt, Core::Archive, Core::Disk, Core::Dmi, Core::File, Core::Find, Core::Group, Core::IP, Core::Mount, Core::Path, Core::Socket, Core::Stat, Core::Stream, Core::System, Core::Transfer, Core::User, Core::Yum, Core::Zypper
- Defined in:
- lib/kanrisuru/os_package/define.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
6 7 8 9 |
# File 'lib/kanrisuru/os_package/define.rb', line 6 def self.extended(base) base.instance_variable_set(:@os_method_properties, {}) base.instance_variable_set(:@os_methods, Set.new) end |
Instance Method Details
#os_define(os_name, method_name, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kanrisuru/os_package/define.rb', line 11 def os_define(os_name, method_name, = {}) unique_method_name = [:alias] || method_name @os_methods.add(method_name) if @os_method_properties.key?(unique_method_name) params = { os_name: os_name.to_s, method_name: method_name, options: } @os_method_properties[unique_method_name].prepend(params) else @os_method_properties[unique_method_name] = [{ os_name: os_name.to_s, method_name: method_name, options: }] end end |