Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/amee.rb
Instance Method Summary collapse
- #is_json? ⇒ Boolean
- #is_v2_atom? ⇒ Boolean
- #is_v2_json? ⇒ Boolean
- #is_v2_xml? ⇒ Boolean
- #is_xml? ⇒ Boolean
Instance Method Details
#is_json? ⇒ Boolean
12 13 14 |
# File 'lib/amee.rb', line 12 def is_json? slice(0,1) == '{' end |
#is_v2_atom? ⇒ Boolean
24 25 26 |
# File 'lib/amee.rb', line 24 def is_v2_atom? is_xml? && (include?('<feed ') || include?('<entry ')) && include?('xmlns:amee="http://schemas.amee.cc/2.0"') end |
#is_v2_json? ⇒ Boolean
15 16 17 |
# File 'lib/amee.rb', line 15 def is_v2_json? is_json? && match('"apiVersion"\s?:\s?"2.0"') end |
#is_v2_xml? ⇒ Boolean
21 22 23 |
# File 'lib/amee.rb', line 21 def is_v2_xml? is_xml? && include?('<Resources xmlns="http://schemas.amee.cc/2.0">') end |
#is_xml? ⇒ Boolean
18 19 20 |
# File 'lib/amee.rb', line 18 def is_xml? slice(0,5) == '<?xml' end |