Class: LoyalPassport::Homework

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/loyal_passport/homework.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authoritie_configsObject



16
17
18
# File 'app/models/loyal_passport/homework.rb', line 16

def self.authoritie_configs
  ::LoyalPassport.config.authoritie_configs
end

Instance Method Details

#authoritie_job_configObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/loyal_passport/homework.rb', line 20

def authoritie_job_config
  @authoritie_job_config ||= (
    config = (
      (
        self.class.authoritie_configs[self.name] || {}
      )[:jobs] || {}
    )[self.job_name]

    case config
    when Hash
      config
    when String
      {:desc => config}
    end
  )
end

#authoritie_job_config?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/loyal_passport/homework.rb', line 37

def authoritie_job_config?
  self.authoritie_job_config.is_a?(Hash)
end