Class: Apiwork::API::Info::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/apiwork/api/info/contact.rb

Overview

Contact information block.

Used within the ‘contact` block in Apiwork::API::Info.

Instance Method Summary collapse

Constructor Details

#initializeContact

Returns a new instance of Contact.



11
12
13
14
15
# File 'lib/apiwork/api/info/contact.rb', line 11

def initialize
  @email = nil
  @name = nil
  @url = nil
end

Instance Method Details

#email(value = nil) ⇒ String?

The contact email.

Examples:

email 'support@example.com'
contact.email # => "support@example.com"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The email.

Returns:

  • (String, nil)


43
44
45
46
47
# File 'lib/apiwork/api/info/contact.rb', line 43

def email(value = nil)
  return @email if value.nil?

  @email = value
end

#name(value = nil) ⇒ String?

The contact name.

Examples:

name 'API Support'
contact.name # => "API Support"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The name.

Returns:

  • (String, nil)


27
28
29
30
31
# File 'lib/apiwork/api/info/contact.rb', line 27

def name(value = nil)
  return @name if value.nil?

  @name = value
end

#url(value = nil) ⇒ String?

The contact URL.

Examples:

url 'https://example.com/support'
contact.url # => "https://example.com/support"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The URL.

Returns:

  • (String, nil)


59
60
61
62
63
# File 'lib/apiwork/api/info/contact.rb', line 59

def url(value = nil)
  return @url if value.nil?

  @url = value
end