Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/curies/curie.rb

Instance Method Summary collapse

Instance Method Details

#could_be_a_safe_curie?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/curies/curie.rb', line 2

def could_be_a_safe_curie?
  self[0,1] == "[" and self[length - 1, length] == "]"
end

#curie_partsObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/curies/curie.rb', line 5

def curie_parts
  if self.could_be_a_safe_curie?
    g = self.split(':')
    a = g[0][1,g[0].length]
    b = g[1][0,g[1].length-1]
    [a,b]
  else
    raise "not a real curie"
  end
end