Class: OpenApi::Contact
- Inherits:
-
Object
- Object
- OpenApi::Contact
- Includes:
- EquatableAsContent
- Defined in:
- lib/open_api/contact.rb
Overview
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name: nil, url: nil, email: nil) ⇒ Contact
constructor
A new instance of Contact.
Methods included from EquatableAsContent
Constructor Details
#initialize(name: nil, url: nil, email: nil) ⇒ Contact
Returns a new instance of Contact.
8 9 10 11 12 |
# File 'lib/open_api/contact.rb', line 8 def initialize(name: nil, url: nil, email: nil) self.name = name self.url = url self.email = email end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/open_api/contact.rb', line 6 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/open_api/contact.rb', line 6 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/open_api/contact.rb', line 6 def url @url end |
Class Method Details
.load(hash) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/open_api/contact.rb', line 14 def self.load(hash) return unless hash new( name: hash["name"]&.to_s, url: hash["url"]&.to_s, email: hash["email"]&.to_s, ) end |