Class: Spandx::Core::Guess
- Inherits:
-
Object
- Object
- Spandx::Core::Guess
- Defined in:
- lib/spandx/core/guess.rb
Instance Attribute Summary collapse
-
#catalogue ⇒ Object
readonly
Returns the value of attribute catalogue.
Instance Method Summary collapse
-
#initialize(catalogue) ⇒ Guess
constructor
A new instance of Guess.
- #license_for(raw) ⇒ Object
Constructor Details
#initialize(catalogue) ⇒ Guess
Returns a new instance of Guess.
8 9 10 |
# File 'lib/spandx/core/guess.rb', line 8 def initialize(catalogue) @catalogue = catalogue end |
Instance Attribute Details
#catalogue ⇒ Object (readonly)
Returns the value of attribute catalogue.
6 7 8 |
# File 'lib/spandx/core/guess.rb', line 6 def catalogue @catalogue end |
Instance Method Details
#license_for(raw) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/spandx/core/guess.rb', line 12 def license_for(raw) case raw when Hash from_hash(raw) when Array from_array(raw) else from_string(raw) end end |