Class: OasCore::Spec::Contact

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_core/spec/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Specable

#as_json, #to_spec

Constructor Details

#initialize(**kwargs) ⇒ Contact

Returns a new instance of Contact.



9
10
11
12
13
# File 'lib/oas_core/spec/contact.rb', line 9

def initialize(**kwargs)
  @name = kwargs[:name] || ''
  @url = kwargs[:url] || ''
  @email = kwargs[:email] || ''
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



7
8
9
# File 'lib/oas_core/spec/contact.rb', line 7

def email
  @email
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/oas_core/spec/contact.rb', line 7

def name
  @name
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/oas_core/spec/contact.rb', line 7

def url
  @url
end

Instance Method Details

#oas_fieldsObject



15
16
17
# File 'lib/oas_core/spec/contact.rb', line 15

def oas_fields
  i[name url email]
end