Class: Ritsu::ExternalLibrary
- Inherits:
-
Object
- Object
- Ritsu::ExternalLibrary
- Includes:
- Utility::Accessors, Utility::InstanceSet
- Defined in:
- lib/ritsu/external_library.rb,
lib/ritsu/ext/cuda/external_library.rb
Instance Attribute Summary collapse
-
#cmake_depend_script ⇒ Object
Returns the value of attribute cmake_depend_script.
-
#cmake_find_script ⇒ Object
Returns the value of attribute cmake_find_script.
-
#cmake_name ⇒ Object
Returns the value of attribute cmake_name.
-
#cuda_depend_script ⇒ Object
Returns the value of attribute cuda_depend_script.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ ExternalLibrary
constructor
A new instance of ExternalLibrary.
-
#initialize_before_cuda ⇒ ExternalLibrary
A new instance of ExternalLibrary.
Methods included from Utility::InstanceSet
included, #initialize_instance
Methods included from Utility::Accessors
Constructor Details
#initialize(name, options = {}) ⇒ ExternalLibrary
Returns a new instance of ExternalLibrary.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ritsu/external_library.rb', line 20 def initialize(name, ={}) = { :cmake_name => '', :cmake_find_script => '', :cmake_depend_script => ''}.merge() @name = name @cmake_name = [:cmake_name] @cmake_find_script = [:cmake_find_script] @cmake_depend_script = [:cmake_depend_script] ExternalLibrary.instances << self end |
Instance Attribute Details
#cmake_depend_script ⇒ Object
Returns the value of attribute cmake_depend_script.
14 15 16 |
# File 'lib/ritsu/external_library.rb', line 14 def cmake_depend_script @cmake_depend_script end |
#cmake_find_script ⇒ Object
Returns the value of attribute cmake_find_script.
13 14 15 |
# File 'lib/ritsu/external_library.rb', line 13 def cmake_find_script @cmake_find_script end |
#cmake_name ⇒ Object
Returns the value of attribute cmake_name.
12 13 14 |
# File 'lib/ritsu/external_library.rb', line 12 def cmake_name @cmake_name end |
#cuda_depend_script ⇒ Object
Returns the value of attribute cuda_depend_script.
5 6 7 |
# File 'lib/ritsu/ext/cuda/external_library.rb', line 5 def cuda_depend_script @cuda_depend_script end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/ritsu/external_library.rb', line 11 def name @name end |
Class Method Details
.find_by_name(name) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/ritsu/external_library.rb', line 38 def self.find_by_name(name) instances.each do |instance| if instance.name == name return instance end end return nil end |
.validate_instance(instance) ⇒ Object
32 33 34 35 36 |
# File 'lib/ritsu/external_library.rb', line 32 def self.validate_instance(instance) if instances.select { |x| x.name == instance.name }.length > 0 raise ArgumentError.new("external library with name '#{instance.name}' already exists") end end |
Instance Method Details
#initialize_before_cuda ⇒ ExternalLibrary
Returns a new instance of ExternalLibrary.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ritsu/ext/cuda/external_library.rb', line 8 def initialize(name, ={}) = { :cmake_name => '', :cmake_find_script => '', :cmake_depend_script => ''}.merge() @name = name @cmake_name = [:cmake_name] @cmake_find_script = [:cmake_find_script] @cmake_depend_script = [:cmake_depend_script] ExternalLibrary.instances << self end |