unidom-article_number 0.1 → 0.2
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7de0706dfa0e448dc072db184879fec4e0ed842
|
|
4
|
+
data.tar.gz: 87a7c86977789993e6136ff42917c892514b14e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 182853a2a42d32ba9c230b9d002a7e85cde80ec7d4522f9c867047546af01cba88d13080fd593b2aee637fbd4d95e04dc60589c95ae04c290f8306ddef744721
|
|
7
|
+
data.tar.gz: d6e240edf602bfd3f7802f0b496cac199bd0551ffedf3605d017215993173dc0140bbbb63b2b3622bd4f7951231a8686495153518a0718e8d374ffdfa867a454
|
data/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# Unidom Article Number 物品编码领域模型引擎
|
|
2
2
|
|
|
3
3
|
[](http://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://badge.fury.io/rb/unidom-article_number)
|
|
5
|
+
[](https://travis-ci.org/topbitdu/unidom-article_number)
|
|
6
|
+
[](https://ci.appveyor.com/project/topbitdu/unidom-article-number)
|
|
4
7
|
|
|
5
8
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Article Number domain model engine includes EAN-13, EAN-8, and IMEI models.
|
|
6
9
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。物品编码领域模型引擎包括EAN-13、EAN-8和IMEI的模型。
|
|
7
10
|
|
|
8
|
-
## Usage in Gemfile
|
|
11
|
+
## Usage in Gemfile
|
|
9
12
|
```ruby
|
|
10
13
|
gem 'unidom-article_number'
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
## Run the Database Migration
|
|
16
|
+
## Run the Database Migration
|
|
14
17
|
```shell
|
|
15
18
|
rake db:migrate
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
## Call the Model
|
|
21
|
+
## Call the Model
|
|
19
22
|
```ruby
|
|
20
23
|
Unidom::ArticleNumber::Ean13Barcode.coded_as('1234567890123').valid_at.alive.first.markings
|
|
21
24
|
```
|
|
@@ -14,7 +14,7 @@ class Unidom::ArticleNumber::Code128Barcode < ::ActiveRecord::Base
|
|
|
14
14
|
|
|
15
15
|
has_many :markings, class_name: 'Unidom::ArticleNumber::Marking'
|
|
16
16
|
|
|
17
|
-
include
|
|
17
|
+
include Unidom::Common::Concerns::ModelExtension
|
|
18
18
|
|
|
19
19
|
def weighted_modulo_103_checksum(codes)
|
|
20
20
|
sum = 103
|
|
@@ -17,7 +17,7 @@ class Unidom::ArticleNumber::Ean13Barcode < ActiveRecord::Base
|
|
|
17
17
|
|
|
18
18
|
has_many :markings, class_name: 'Unidom::ArticleNumber::Marking'
|
|
19
19
|
|
|
20
|
-
include
|
|
20
|
+
include Unidom::Common::Concerns::ModelExtension
|
|
21
21
|
|
|
22
22
|
def code=(code)
|
|
23
23
|
code = code.to_s
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-article_number
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.2'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Topbit Du
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -75,5 +75,5 @@ rubyforge_project:
|
|
|
75
75
|
rubygems_version: 2.4.5.1
|
|
76
76
|
signing_key:
|
|
77
77
|
specification_version: 4
|
|
78
|
-
summary:
|
|
78
|
+
summary: Unidom Article Number Domain Model Engine 物品编码领域模型引擎
|
|
79
79
|
test_files: []
|