Class: Eco::API::Session::Config::People

Inherits:
BaseConfig show all
Defined in:
lib/eco/api/session/config/people.rb

Instance Attribute Summary

Attributes inherited from BaseConfig

#config

Instance Method Summary collapse

Methods inherited from BaseConfig

#apis, attr_key, #clone, #file_manager, #initialize

Methods inherited from Hash

#deep_merge, #deep_merge!

Constructor Details

This class inherits a constructor from Eco::API::Session::Config::BaseConfig

Instance Method Details

#api_excluded(&block) ⇒ Object

with given a person what is the criteria of exclusion



51
52
53
54
# File 'lib/eco/api/session/config/people.rb', line 51

def api_excluded(&block)
  return self["api_excluded"] unless block_given?
  self["api_excluded"] = block
end

#cacheObject



11
12
13
# File 'lib/eco/api/session/config/people.rb', line 11

def cache
  self["cache"] ||= "cache/people.json"
end

#cache=(file) ⇒ Object



7
8
9
# File 'lib/eco/api/session/config/people.rb', line 7

def cache=(file)
  self["cache"] = file
end

#default_login_method?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/eco/api/session/config/people.rb', line 77

def 
  !!
end

#default_schema?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/eco/api/session/config/people.rb', line 73

def default_schema?
  !!default_schema
end

#default_usergroup?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/eco/api/session/config/people.rb', line 69

def default_usergroup?
  !!default_usergroup
end

#discarded_fileObject



46
47
48
# File 'lib/eco/api/session/config/people.rb', line 46

def discarded_file
  self["discarded_file"]
end

#discarded_file=(file) ⇒ Object

people to exclude from update feeds



42
43
44
# File 'lib/eco/api/session/config/people.rb', line 42

def discarded_file=(file)
  self["discarded_file"] = file
end

#fields_mapperObject



61
62
63
# File 'lib/eco/api/session/config/people.rb', line 61

def fields_mapper
  self["fields_mapper"]
end

#fields_mapper=(file) ⇒ Object

internal-external fields map



57
58
59
# File 'lib/eco/api/session/config/people.rb', line 57

def fields_mapper=(file)
  self["fields_mapper"] = file
end

#parser(format: :csv) ⇒ Eco::API::Common::People::PersonParser

The person parser/serializer for a given format (default csv).

Parameters:

  • format (Symbol) (defaults to: :csv)

    the format this parser/serializer recognizes.

Returns:



89
90
91
92
93
94
95
96
97
# File 'lib/eco/api/session/config/people.rb', line 89

def parser(format: :csv)
  prs = parsers[format] ||= Eco::API::Common::People::PersonParser.new
  if block_given?
    yield(prs)
    self
  else
    prs
  end
end

#parsersHash

Returns with defined pairs format key and Person parsers.

Returns:

  • (Hash)

    with defined pairs format key and Person parsers.



82
83
84
# File 'lib/eco/api/session/config/people.rb', line 82

def parsers
  self["parsers"] ||= {}
end

#partial_cacheObject



15
16
17
18
19
20
21
# File 'lib/eco/api/session/config/people.rb', line 15

def partial_cache
  if file = self.cache
    File.join(File.dirname(file),
      File.basename(file, File.extname(file)) + "_partial" + File.extname(file)
    )
  end
end

#requests_folderObject



37
38
39
# File 'lib/eco/api/session/config/people.rb', line 37

def requests_folder
  self["requests_folder"] ||= "requests"
end

#requests_folder=(folder) ⇒ Object

api queried logs



33
34
35
# File 'lib/eco/api/session/config/people.rb', line 33

def requests_folder=(folder)
  self["requests_folder"] = folder
end

#strict_search=(value) ⇒ Object

specifies if people search should be strict or not



24
25
26
# File 'lib/eco/api/session/config/people.rb', line 24

def strict_search=(value)
  self["strict_search"] = !!value
end

#strict_search?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/eco/api/session/config/people.rb', line 28

def strict_search?
  self["strict_search"]
end