everyday-menu 1.3.8 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/everyday-menu/menu_item.rb +25 -0
- data/lib/everyday-menu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7a0c4812a6ca33d2f304c08b6e1c5953cac3de
|
4
|
+
data.tar.gz: f935a7fbbb440c749ffca010e0056edad7296397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a02c392a889ae0c05019bd8fa316f1c7eddd2256abbc3c1fbdb0d2e4b023eb28f75198215ec1d38b4b404b120138e43c85f73874cfe4da5f912f9ee738349a1
|
7
|
+
data.tar.gz: bd7f6fc315156669b3ec6ab72ecbd6c8ebc95477c14a72e617491c1b400b1df94e810787a5f082442e08d8d03b03c27ce83807c368f983345592c24a2e395d82
|
@@ -1,4 +1,16 @@
|
|
1
1
|
module EverydayMenu
|
2
|
+
class DynamicTitle
|
3
|
+
attr_accessor :title
|
4
|
+
def initialize(getter, item, title)
|
5
|
+
@getter = getter
|
6
|
+
@item = item
|
7
|
+
@title = title
|
8
|
+
@item.bind('title', toObject: self, withKeyPath: 'title', options: { 'NSContinuouslyUpdatesValue' => true })
|
9
|
+
end
|
10
|
+
def update
|
11
|
+
self.performSelectorOnMainThread('title=:', withObject: @getter.call, waitUntilDone: false)
|
12
|
+
end
|
13
|
+
end
|
2
14
|
class MenuItem
|
3
15
|
include MyAccessors
|
4
16
|
|
@@ -126,6 +138,19 @@ module EverydayMenu
|
|
126
138
|
|
127
139
|
def_presets
|
128
140
|
|
141
|
+
my_attr_reader :dynamicTitle
|
142
|
+
|
143
|
+
def setDynamicTitle(getter)
|
144
|
+
@dynamicTitle = EverydayMenu::DynamicTitle.new(getter, self.item, self[:title])
|
145
|
+
end
|
146
|
+
|
147
|
+
alias :dynamicTitle= :setDynamicTitle
|
148
|
+
alias :dynamic_title= :setDynamicTitle
|
149
|
+
|
150
|
+
def updateDynamicTitle
|
151
|
+
@dynamicTitle.update if @dynamicTitle
|
152
|
+
end
|
153
|
+
|
129
154
|
def runOnBuild
|
130
155
|
onBuild.each { |block| block.call }
|
131
156
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everyday-menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|