module NexmoApiSpecification::Definition
Public Class Methods
exists?(definition)
click to toggle source
# File lib/nexmo_api_specification/definition.rb, line 16 def self.exists?(definition) File.exist? path(definition) end
load(definition)
click to toggle source
# File lib/nexmo_api_specification/definition.rb, line 3 def self.load(definition) return false unless exists?(definition) File.read(path(definition)) end
load!(definition)
click to toggle source
# File lib/nexmo_api_specification/definition.rb, line 8 def self.load!(definition) load(definition) || raise('Definition does not exist') end
path(definition)
click to toggle source
# File lib/nexmo_api_specification/definition.rb, line 12 def self.path(definition) File.join NexmoApiSpecification.root, 'definitions', "#{definition}.yml" end