status_tag 0.1.0 → 0.1.1

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: e40ce1236e635e3ebe7e29aa9894a3058958041b
4
- data.tar.gz: a50a76c6ddac86762f4609bb91812b5291672132
3
+ metadata.gz: 1820003db19578e9ff2ee219baca893e3d4d7cef
4
+ data.tar.gz: 6eb26b46cbc8074ffca7cdf0b80457e48111d24a
5
5
  SHA512:
6
- metadata.gz: 595707bd6f6597902fae0f2f42ef16aec5af4b3c3a9afecc6d26c0c4d5de069615890e4af848e77fdf43d9059e7483f4fae8c9799134bc97838fc534ee6a0a93
7
- data.tar.gz: a9da7ece09d57c4da07f8d7a6ce9dd6902460d48c9cbcfeeca5eed42ac4fd79e11a90a5cd0e6552b5082852589368e6c69c49d1bf5caeefc38222526b8fc2bee
6
+ metadata.gz: 81431153ab80c60eff6bdf6cb3145846d8e9e75c680e8c05b116c0ff0d4fd1f71a2c2791d5473071b6d3b0665d5f1255a9211376a488b4ae1aaa6ffac8476e9d
7
+ data.tar.gz: f994ee655f93a81f5ce6b2febf0910f57167ba0db45256d13c6c5f7f9a4f35f38d6e90a1a467d5b3df4bf6618a76030d7d356230ee2c8c33f013207cb6fa3345
@@ -17,6 +17,9 @@ module StatusTag
17
17
  # Override constants in subclasses
18
18
  ORDERED_CHOICES = [StatusTag::Choice.new]
19
19
  CSS_CLASS = [] # A CSS class or classes to assign to all tags generated with the presenter
20
+ DECIDE_ON = :object # or :self, which will send the messages to the presenter class
21
+ # (which has an internal reference to object) and would allow more complicated logic that
22
+ # pertains to the view, not the model.
20
23
 
21
24
  attr_accessor :object, # e.g. an instance of the User class
22
25
  :aspect # e.g. "state", "status" or some other descriptive name for this particular status tag
@@ -31,7 +34,11 @@ module StatusTag
31
34
  end
32
35
 
33
36
  def decide
34
- decider.decide(object)
37
+ if (self.class)::DECIDE_ON == :object
38
+ decider.decide(object)
39
+ else
40
+ decider.decide(self)
41
+ end
35
42
  end
36
43
 
37
44
  # An alternative to overriding the constant in subclasses is to override this method.
@@ -1,3 +1,3 @@
1
1
  module StatusTag
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: status_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling