Class: Swagger::Data::License
- Inherits:
-
Object
- Object
- Object
- Swagger::Data::License
show all
- Defined in:
- lib/ruby-swagger/data/license.rb
Overview
Constant Summary
collapse
- DEFAULT_NAME =
'Apache 2.0'
- DEFAULT_URL =
'http://www.apache.org/licenses/LICENSE-2.0.html'
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Object
attr_swagger, #bulk_set, #swagger_attributes, #to_json, #to_swagger, #to_yaml
Constructor Details
Returns a new instance of License.
Class Method Details
.parse(license) ⇒ Object
17
18
19
20
21
|
# File 'lib/ruby-swagger/data/license.rb', line 17
def self.parse(license)
return nil unless license
Swagger::Data::License.new.bulk_set(license)
end
|
Instance Method Details
#name=(new_name) ⇒ Object
23
24
25
26
|
# File 'lib/ruby-swagger/data/license.rb', line 23
def name=(new_name)
raise (ArgumentError.new("Swagger::Data::License - license name is invalid ")) if new_name.nil? || new_name.empty?
@name = new_name
end
|
36
37
38
|
# File 'lib/ruby-swagger/data/license.rb', line 36
def url
@url.url
end
|
#url=(url) ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/ruby-swagger/data/license.rb', line 28
def url=(url)
return nil unless url
@url = Swagger::Data::Url.new(url)
validate_url!
@url
end
|
#valid? ⇒ Boolean
40
41
42
|
# File 'lib/ruby-swagger/data/license.rb', line 40
def valid?
@url.valid?
end
|