class DailyRep::Configer

Public Class Methods

enabled_entities() click to toggle source

+

# File lib/dailyrep/Loadconfig.rb, line 101
def self.enabled_entities
  @@config_json[PA_ENTITIES].keys.map { |entity|
    entity.downcase.capitalize if is_entity_enabled?(entity)
  }
end
exctract_entity_params(entity, parameter_name) click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 85
def self.exctract_entity_params entity, parameter_name
  @@config_json[PA_ENTITIES][entity][parameter_name]
end
get_client_tokens() click to toggle source

+

# File lib/dailyrep/Loadconfig.rb, line 107
def self.get_client_tokens
  @@config_json[P_PUSH_CLIENTS].values
end
get_search_strs(entity) click to toggle source

def self.include_search_strs? entity

result = false
result = true if @@config_json[PA_ENTITIES][entity][P_SEARCH_STRS]
return result

end

# File lib/dailyrep/Loadconfig.rb, line 117
def self.get_search_strs entity
  @@config_json[PA_ENTITIES][entity][P_SEARCH_STRS]
end
index_path() click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 73
def self.index_path
  @@config_json[P_INDEX_PATH]
end
is_entity_enabled?(entity) click to toggle source

+

# File lib/dailyrep/Loadconfig.rb, line 93
def self.is_entity_enabled? entity
  time_arr = @@config_json[PA_ENTITIES][entity][P_TIME_FRAME].split('..').map { |el|
    el.to_i
  }
  (time_arr[0]..time_arr[1]).include?(Time.now.hour) &&
    @@config_json[PA_ENTITIES][entity][P_ENABLED].to_bool
end
is_phase_enabled?(phase) click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 89
def self.is_phase_enabled? phase
  @@config_json[PA_APP_CYCLE][phase].to_bool
end
method_missing(meth, *args, &block) click to toggle source
Calls superclass method
# File lib/dailyrep/Loadconfig.rb, line 121
def self.method_missing(meth, *args, &block)
  method_inputs = meth.to_s.split('_')
  out_param = ''
  @@config_json[PA_ENTITIES].keys.each { |key|
    if method_inputs[0] == key.downcase
      out_param = self.exctract_entity_params method_inputs[0], method_inputs[1]
    end
  }
  super if not @@config_json[PA_ENTITIES].keys.include?(method_inputs[0])
  return out_param
end
push_note_title() click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 77
def self.push_note_title
  @@config_json[P_PUSH_NOTE_TITLE]
end
raise_error?() click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 81
def self.raise_error?
  @@config_json[P_RAISE_ERRORS].to_bool
end
set_index_file(file) click to toggle source
# File lib/dailyrep/Loadconfig.rb, line 67
def self.set_index_file file
  @@config_json[P_INDEX_PATH] = file
end