Module: RKit

Extended by:
RKit
Included in:
RKit
Defined in:
lib/r_kit.rb,
lib/r_kit/version.rb

Defined Under Namespace

Classes: Backtrace, Core, Css, Decorator, Grid

Constant Summary collapse

VERSION =
"0.3.2"

Instance Method Summary collapse

Instance Method Details

#inspectObject



3
4
5
6
7
# File 'lib/r_kit.rb', line 3

def inspect
  "#{ name }"
  # TODO: add a brief, link to the doc, list of all services, and demo of inspect method for services
  # some kind of "--help" of unix commands
end

#load(*services) ⇒ Object



10
11
12
# File 'lib/r_kit.rb', line 10

def load *services
  load_service_from Array.wrap(services)
end

#load_service_from(service) ⇒ Object



15
16
17
# File 'lib/r_kit.rb', line 15

def load_service_from service
  send "load_service_from_#{ service.class.name.underscore }", service
end

#load_service_from_array(services) ⇒ Object



19
20
21
22
23
# File 'lib/r_kit.rb', line 19

def load_service_from_array services
  services.each do |service|
    load_service_from service
  end
end

#load_service_from_hash(services) ⇒ Object



30
31
32
33
34
# File 'lib/r_kit.rb', line 30

def load_service_from_hash services
  services.each do |service, config = {}|
    load_service_from_symbol service, config: config
  end
end

#load_service_from_symbol(service, config: {}) ⇒ Object Also known as: load_service_from_string



25
26
27
# File 'lib/r_kit.rb', line 25

def load_service_from_symbol service, config: {}
  RKit.const_get(service.to_s.classify).load config
end