Module: Mull::Container

Extended by:
Container
Included in:
Container
Defined in:
lib/mull.rb

Instance Method Summary collapse

Instance Method Details

#config(key) ⇒ Object



23
24
25
26
# File 'lib/mull.rb', line 23

def config key
  @config ||= YAML.load_file('mull.yml')
  @config[key.to_s]
end

#fileObject



19
# File 'lib/mull.rb', line 19

def file; File; end

#file_utilObject



45
46
47
48
49
50
51
# File 'lib/mull.rb', line 45

def file_util
  Mull::FileUtil.new(
    path_prefix: config(:path_prefix),
    file: file,
    file_utils: file_utils
  )
end

#file_utilsObject



18
# File 'lib/mull.rb', line 18

def file_utils; FileUtils; end

#httpObject



20
# File 'lib/mull.rb', line 20

def http; HTTParty; end

#request(definition:) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/mull.rb', line 28

def request(definition:)
  Request.new(
    definition: definition,
    file_utils: file_util,
    http: http,
    root_url: config(:root_url)
  )
end

#response(definition:) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/mull.rb', line 37

def response(definition:)
  Response.new(
    definition: definition,
    file_utils: file_util,
    server: server
  )
end

#serverObject



21
# File 'lib/mull.rb', line 21

def server; MullServer; end