Class: TCCE::File
- Inherits:
-
Object
- Object
- TCCE::File
- Defined in:
- lib/tcce/file.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Class Method Summary collapse
-
.parse(content) ⇒ TCCE::File
Parse a file given by argument.
Instance Method Summary collapse
- #certificates ⇒ Object
- #email ⇒ Object
- #http_challenge ⇒ Object
- #private_key ⇒ Object
- #registration ⇒ Object
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
6 7 8 |
# File 'lib/tcce/file.rb', line 6 def json @json end |
Class Method Details
.parse(content) ⇒ TCCE::File
Parse a file given by argument
15 16 17 18 19 |
# File 'lib/tcce/file.rb', line 15 def self.parse(content) file = TCCE::File.new file.json = JSON.parse content file end |
Instance Method Details
#certificates ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/tcce/file.rb', line 33 def certificates certs = [] json['DomainsCertificate']['Certs'].each do |cert| certificate = TCCE::Certificate.parse cert certs << certificate yield certificate if block_given? end certs end |
#email ⇒ Object
21 22 23 |
# File 'lib/tcce/file.rb', line 21 def email json['Email'] end |
#http_challenge ⇒ Object
43 44 45 |
# File 'lib/tcce/file.rb', line 43 def http_challenge json['HTTPChallenge'] end |
#private_key ⇒ Object
29 30 31 |
# File 'lib/tcce/file.rb', line 29 def private_key json['PrivateKey'] end |
#registration ⇒ Object
25 26 27 |
# File 'lib/tcce/file.rb', line 25 def registration TCCE::Registration.parse json['Registration'] end |