kount-ris 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ module Kount
2
+ module RIS
3
+ module Trigger
4
+ class Counter < Base
5
+ attr_accessor :name, :count
6
+
7
+ validates :name, length: { maximum: 64 } # trigger name
8
+ validates :count, numericality: true # number of times triggered
9
+
10
+ def to_h
11
+ {
12
+ name: name,
13
+ count: count,
14
+ }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ module Kount
2
+ module RIS
3
+ module Trigger
4
+ class Error < Base
5
+ attr_accessor :message
6
+
7
+ validates :message, length: { maximum: 256 } # error code and message
8
+
9
+ def to_h
10
+ {
11
+ message: message,
12
+ }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ module Kount
2
+ module RIS
3
+ module Trigger
4
+ class Rule < Base
5
+ attr_accessor :description, :id
6
+
7
+ validates :description, length: { maximum: 255 } # description of the rule triggered
8
+ validates :id, numericality: true # number of times triggered
9
+
10
+ def to_h
11
+ {
12
+ description: description,
13
+ id: id,
14
+ }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ module Kount
2
+ module RIS
3
+ module Trigger
4
+ class Warning < Base
5
+ attr_accessor :message
6
+
7
+ validates :message, length: { maximum: 256 } # warning code and message
8
+
9
+ def to_h
10
+ {
11
+ message: message,
12
+ }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,39 @@
1
+ # require "yaml"
2
+ # require "erb"
3
+
4
+ # kount_configuration =
5
+
6
+
7
+ # module Rails
8
+ # class Application
9
+
10
+ # # based on Rails::Application::Configuration#database_configuration
11
+ # # in rails/railties/lib/rails/application/configuration.rb
12
+ # module ConfigurationExtension
13
+ # extend ActiveSupport::Concern
14
+
15
+ # def parse(path)
16
+ # yaml = Pathname.new(path) if path
17
+
18
+ # config = if yaml && yaml.exist?
19
+ # YAML.load(ERB.new(yaml.read).result) || {}
20
+ # else
21
+ # raise "No such file - #{path}"
22
+ # end
23
+
24
+ # configuration_attr = :"#{path.to_s.split('/').last.split('.').first.underscore}_configuration"
25
+ # Rails::Application::Configuration.send(:attr_accessor, configuration_attr)
26
+
27
+ # Rails.configuration.send("#{configuration_attr}=", config.with_indifferent_access)
28
+ # rescue Psych::SyntaxError => e
29
+ # raise "YAML syntax error occurred while parsing #{path}. " \
30
+ # "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
31
+ # "Error: #{e.message}"
32
+ # rescue => e
33
+ # raise e, "Cannot load #{path.to_s.split('/').last.split('.').first.humanize.downcase} configuration:\n#{e.message}", e.backtrace
34
+ # end
35
+ # end
36
+
37
+ # Configuration.send(:include, ConfigurationExtension)
38
+ # end
39
+ # end
@@ -0,0 +1,10 @@
1
+ require 'kount/ris/engine'
2
+ require_relative '../../app/models/kount'
3
+ require_relative '../../app/models/kount/ris'
4
+ require_relative '../../app/models/kount/configuration'
5
+
6
+ module Kount
7
+ module RIS
8
+ # Your code goes here...
9
+ end
10
+ end
@@ -0,0 +1,21 @@
1
+ module Kount
2
+ module RIS
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Kount::RIS
5
+ # config.generators.api_only = true
6
+ # config.eager_load_paths.concat Dir["#{config.root}/doc/*"].select { |f| File.directory? f }
7
+ # config.autoload_paths.concat Dir["#{config.root}/app/models/**"]
8
+
9
+ # initializer 'admin', before: :load_config_initializers do |app|
10
+ # Rails.application.routes.append do
11
+ # mount Admin::Engine, at: "/admin"
12
+ # end
13
+ # end
14
+
15
+ # initializer 'admin', after: :load_config_initializers do |app|
16
+ # Admin.load_files.each { |file| require file }
17
+ # app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
18
+ # end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ module Kount
2
+ module RIS
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kount-ris
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - blaq reports
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-12-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Kount RIS
56
+ email:
57
+ - support@blaqreports.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - README.md
63
+ - Rakefile
64
+ - app/models/kount.rb
65
+ - app/models/kount/configuration.rb
66
+ - app/models/kount/khash.rb
67
+ - app/models/kount/ris.rb
68
+ - app/models/kount/ris/address.rb
69
+ - app/models/kount/ris/base.rb
70
+ - app/models/kount/ris/device.rb
71
+ - app/models/kount/ris/inquiry.rb
72
+ - app/models/kount/ris/location.rb
73
+ - app/models/kount/ris/persona.rb
74
+ - app/models/kount/ris/product.rb
75
+ - app/models/kount/ris/response.rb
76
+ - app/models/kount/ris/trigger/counter.rb
77
+ - app/models/kount/ris/trigger/error.rb
78
+ - app/models/kount/ris/trigger/rule.rb
79
+ - app/models/kount/ris/trigger/warning.rb
80
+ - config/initializers/configuration.rb
81
+ - lib/kount/ris.rb
82
+ - lib/kount/ris/engine.rb
83
+ - lib/kount/ris/version.rb
84
+ homepage:
85
+ licenses: []
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.6.14
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Kount RIS
107
+ test_files: []