yinx 0.1.3 → 0.1.4

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: 880a04045c8e6c8440578512ed8ab6275859e117
4
- data.tar.gz: 7adab8f487351c63c2d86d0c66f3b410bd8b31e7
3
+ metadata.gz: 2d67cb04a9f0fe207f50c9f69cb16fd335561079
4
+ data.tar.gz: 693fb4ea0819cd49326cc851c018193f0f6d6c48
5
5
  SHA512:
6
- metadata.gz: b5153da461f91c61e8e658296637e74730ea575947d55d3cfd4ab08ad94920a9824fe5e3163062b3704701f1537925ef0b33fd856ce7b5715cd51163be7dcd4b
7
- data.tar.gz: 9dd463d49b5a73dca6c7428151c9eb473e78b6ba4c1653f1a19d7446225d39c23647c6d9701634618f1c195b75ecd7281e949c60e6bf4c4d36813819803f7cfe
6
+ metadata.gz: 007c25beaaa88a1b947054b0a5fcc2547c15a49ff941625086caf8814d33cbf6513c4816a61c36a0bb12ded91bc9c343b0a6643ffdaf796e5b0ec56a1232f3aa
7
+ data.tar.gz: 1f22ad2cabeb1258a27dad4d4856fab1749d44e4bc679ef850b25f1f7f74b350ad43ba5f929fc64934b049dbddbcf9a6bb70596b727cd54b61816f5a880ae27b
data/lib/yinx/array.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Array
2
+ def to_yinx
3
+ map &:to_yinx
4
+ end
5
+ end
data/lib/yinx/hash.rb ADDED
@@ -0,0 +1,9 @@
1
+ class Hash
2
+ def to_yinx
3
+ raw = Yinx::NoteMeta.raw
4
+ raise TypeError, "can not convert #{self} to Yinx::NoteMeta" unless raw.send(:attr_methods).all?{|m| self.has_key?(m) or self.has_key?(m.to_s)}
5
+ raw.marshal_load self
6
+ raw
7
+ end
8
+
9
+ end
@@ -1,6 +1,8 @@
1
1
  require 'evernote-thrift'
2
+ require 'yinx/hash'
3
+ require 'yinx/array'
2
4
 
3
- class NoteMeta
5
+ class Yinx::NoteMeta
4
6
 
5
7
  [:updated, :created, :title, :notebookGuid, :guid, :contentLength, :tagGuids].each do |method|
6
8
  define_method method do
@@ -18,6 +20,10 @@ class NoteMeta
18
20
  @store = note_store
19
21
  end
20
22
 
23
+ def self.raw
24
+ new nil, nil
25
+ end
26
+
21
27
  def tags
22
28
  @tags ||= (tagGuids ? tagGuids.map{|id| @store.tag_name id} : [])
23
29
  end
data/lib/yinx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yinx
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-28 00:00:00.000000000 Z
11
+ date: 2017-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,7 +82,9 @@ files:
82
82
  - bin/console
83
83
  - bin/setup
84
84
  - lib/yinx.rb
85
+ - lib/yinx/array.rb
85
86
  - lib/yinx/down_config.rb
87
+ - lib/yinx/hash.rb
86
88
  - lib/yinx/note_meta.rb
87
89
  - lib/yinx/note_store.rb
88
90
  - lib/yinx/user_store.rb