Class: Datasets::License
- Inherits:
-
Struct
- Object
- Struct
- Datasets::License
- Defined in:
- lib/datasets/license.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#spdx_id ⇒ Object
Returns the value of attribute spdx_id.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/datasets/license.rb', line 2 def name @name end |
#spdx_id ⇒ Object
Returns the value of attribute spdx_id
2 3 4 |
# File 'lib/datasets/license.rb', line 2 def spdx_id @spdx_id end |
#url ⇒ Object
Returns the value of attribute url
2 3 4 |
# File 'lib/datasets/license.rb', line 2 def url @url end |
Class Method Details
.try_convert(value) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/datasets/license.rb', line 6 def try_convert(value) case value when self value when String license = new license.spdx_id = value license when Hash license = new license.spdx_id = value[:spdx_id] license.name = value[:name] license.url = value[:url] license else nil end end |