Class: Xolphin::Api::Responses::Certificate

Inherits:
Base
  • Object
show all
Defined in:
lib/xolphin/api/responses/certificate.rb

Instance Method Summary collapse

Methods inherited from Base

#_embedded, #error?, #errors, #limit, #message, #page, #pages, #total

Constructor Details

#initialize(data) ⇒ Certificate

Returns a new instance of Certificate.



7
8
9
# File 'lib/xolphin/api/responses/certificate.rb', line 7

def initialize(data)
  super(data)
end

Instance Method Details

#companyObject



31
32
33
# File 'lib/xolphin/api/responses/certificate.rb', line 31

def company
  @data["company"]
end

#customer_idObject



35
36
37
# File 'lib/xolphin/api/responses/certificate.rb', line 35

def customer_id
  @data["customerId"]
end

#date_expiredObject



27
28
29
# File 'lib/xolphin/api/responses/certificate.rb', line 27

def date_expired
  Time.parse(@data["dateExpired"])
end

#date_issuedObject



23
24
25
# File 'lib/xolphin/api/responses/certificate.rb', line 23

def date_issued
  Time.parse(@data["dateIssued"])
end

#domain_nameObject



15
16
17
# File 'lib/xolphin/api/responses/certificate.rb', line 15

def domain_name
  @data["domainName"]
end

#expired?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/xolphin/api/responses/certificate.rb', line 39

def expired?
  date_expired <= Time.now
end

#idObject



11
12
13
# File 'lib/xolphin/api/responses/certificate.rb', line 11

def id
  @data["id"]
end

#productObject



43
44
45
46
47
48
49
# File 'lib/xolphin/api/responses/certificate.rb', line 43

def product
  @product ||= begin
    if _embedded && _embedded["product"]
      Product.new(_embedded["product"])
    end
  end
end

#subject_alternative_namesObject



19
20
21
# File 'lib/xolphin/api/responses/certificate.rb', line 19

def subject_alternative_names
  @data["subjectAlternativeNames"]
end