Class: OpenApi::License

Inherits:
Object
  • Object
show all
Defined in:
lib/open_api/license.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, url: nil) ⇒ License

Returns a new instance of License.



6
7
8
9
# File 'lib/open_api/license.rb', line 6

def initialize(name:, url: nil)
  self.name = name
  self.url = url
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/open_api/license.rb', line 4

def name
  @name
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/open_api/license.rb', line 4

def url
  @url
end

Class Method Details

.load(hash) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/open_api/license.rb', line 11

def self.load(hash)
  return unless hash

  new(
    name: hash["name"],
    url: hash["url"],
  )
end