module Modgen::API

Public Class Methods

api() click to toggle source
# File lib/modgen/api.rb, line 18
def self.api
  @@api || raise(Modgen::APIError, "API has not been discovered yet.")
end
discovered?() click to toggle source
# File lib/modgen/api.rb, line 22
def self.discovered?
  !@@api.nil?
end
method_missing(method, *args, &block) click to toggle source

All api methods go there

# File lib/modgen/api.rb, line 34
def self.method_missing(method, *args, &block)
  api

  @@api_methods.send(method, *args, &block)
end
methods() click to toggle source

All available API methods on top

# File lib/modgen/api.rb, line 28
def self.methods
  @@api_methods.methods
end
set_api(api) click to toggle source

Set api from discovery

Parameters:

api

Hash

# File lib/modgen/api.rb, line 45
def self.set_api(api)
  @@api = OpenStruct.new(api)
end
set_api_methods(api) click to toggle source

Set api methods from discovery

Parameters:

api

Modgen::API::Resource

# File lib/modgen/api.rb, line 54
def self.set_api_methods(api)
  @@api_methods = api
end