Class: TCCE::Registration
- Inherits:
-
Object
- Object
- TCCE::Registration
- Defined in:
- lib/tcce/registration.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Class Method Summary collapse
-
.parse(content) ⇒ Object
def to_s JSON.pretty_generate json end.
Instance Method Summary collapse
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
3 4 5 |
# File 'lib/tcce/registration.rb', line 3 def json @json end |
Class Method Details
.parse(content) ⇒ Object
def to_s
JSON.pretty_generate json
end
9 10 11 12 13 |
# File 'lib/tcce/registration.rb', line 9 def self.parse(content) file = TCCE::Registration.new file.json = content file end |
Instance Method Details
#contact ⇒ Object
23 24 25 |
# File 'lib/tcce/registration.rb', line 23 def contact contacts.first end |
#contacts ⇒ Object
27 28 29 30 31 32 |
# File 'lib/tcce/registration.rb', line 27 def contacts json['body']['contact'].map do |contact| contact = contact[7..-1] if contact.start_with? 'mailto:' contact end end |
#status ⇒ Object
19 20 21 |
# File 'lib/tcce/registration.rb', line 19 def status json['body']['status'] end |
#uri ⇒ Object
15 16 17 |
# File 'lib/tcce/registration.rb', line 15 def uri json['uri'] end |