Class: SocialSnippet::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/social_snippet/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_input_stream = STDIN, new_output_stream = STDOUT) ⇒ Core

Constructor


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/social_snippet/core.rb', line 23

def initialize(new_input_stream = STDIN, new_output_stream = STDOUT)
  @input_stream   = new_input_stream
  @output_stream  = new_output_stream
  @config = ::SocialSnippet::Config.new(self)
  @logger = ::SocialSnippet::Logger.new output_stream
  init_logger

  @repo_manager = ::SocialSnippet::Repository::RepositoryManager.new(self)
  @registry_client = ::SocialSnippet::Registry::RegistryClient.new(self)
  @api = ::SocialSnippet::Api.new(self)
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api


20
21
22
# File 'lib/social_snippet/core.rb', line 20

def api
  @api
end

#configObject (readonly)

Returns the value of attribute config


17
18
19
# File 'lib/social_snippet/core.rb', line 17

def config
  @config
end

#input_streamObject (readonly)

Returns the value of attribute input_stream


14
15
16
# File 'lib/social_snippet/core.rb', line 14

def input_stream
  @input_stream
end

#loggerObject (readonly)

Returns the value of attribute logger


19
20
21
# File 'lib/social_snippet/core.rb', line 19

def logger
  @logger
end

#output_streamObject (readonly)

Returns the value of attribute output_stream


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

def output_stream
  @output_stream
end

#registry_clientObject (readonly)

Returns the value of attribute registry_client


18
19
20
# File 'lib/social_snippet/core.rb', line 18

def registry_client
  @registry_client
end

#repo_managerObject (readonly)

Returns the value of attribute repo_manager


16
17
18
# File 'lib/social_snippet/core.rb', line 16

def repo_manager
  @repo_manager
end

Instance Method Details

#init_loggerObject


35
36
37
38
# File 'lib/social_snippet/core.rb', line 35

def init_logger
  logger.level = ::SocialSnippet::Logger::Severity::INFO
  logger.level = ::SocialSnippet::Logger::Severity::DEBUG if config.debug?
end