Class: Spandx::Core::Guess

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/core/guess.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#catalogueObject (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