status_tag 0.1.3 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50db7516df1a9992517cc1617e0a73e084166854
4
- data.tar.gz: 92381fed4bb48a184477dc559e976a58f7db68aa
3
+ metadata.gz: ea164cee0e501e85a8cb38bc899b7e7e2579e560
4
+ data.tar.gz: ad09d9846f29418ebb8e01f3a228945da3bae720
5
5
  SHA512:
6
- metadata.gz: 8e5748ea0f37e90cae1ce69a462b159bb121e84a18ee33afd966a9982df1bcd8c7b1a01f16c8204bd0910d77b14d79acd2646633744af69b6c7b0dbccaf25c4b
7
- data.tar.gz: 53b452d3f382b2400f18d30c442bb895048bf03ec625659033ce65d48d06a632cbf173d35439ecce9af1eabcc9f7ea243127794a3de1c03d02e0e7fc624da1cd
6
+ metadata.gz: e7d3cb297e76556e6f572f04f5e799f9aecffa77405a07de184544b3d57be3068cfafd0dcb0817080e85fdcaf53b688928ccc21ca486b88aef3843ee1dbe164c
7
+ data.tar.gz: 3352cb683f641bce5da05e1c853ae0a9d9a56846ec7e6ee6f11c4f0b877417da9cc96fb7dfc548cd04c275153f124eb94b90eab26a5b9f0a4ab7c1522c3cbe00
@@ -17,12 +17,14 @@ 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.
23
- CHOICE_ON = :object # or :self, which will send the messages to the presenter class
24
- # (which has an internal reference to object) and would allow more complicated logic that
25
- # pertains to the view, not the model.
20
+
21
+ # RECEIVER CONFIGURATION
22
+ # :object sends the messages to the object passed into the initializer
23
+ # :self sends the messages to the to the presenter class instance
24
+ # (which has an internal reference to object) and would allow more complicated logic that
25
+ # pertains to the view, not the model.
26
+ CHOICE_NAME_MESSAGE_RECEIVER = :object
27
+ CHOICE_TEXT_MESSAGE_RECEIVER = :object
26
28
 
27
29
  attr_accessor :object, # e.g. an instance of the User class
28
30
  :aspect # e.g. "state", "status" or some other descriptive name for this particular status tag
@@ -38,7 +40,7 @@ module StatusTag
38
40
  end
39
41
 
40
42
  def decide
41
- @choice = if (self.class)::DECIDE_ON == :object
43
+ @choice = if (self.class)::CHOICE_NAME_MESSAGE_RECEIVER == :object
42
44
  decider.decide(object)
43
45
  else
44
46
  decider.decide(self)
@@ -48,7 +50,7 @@ module StatusTag
48
50
  def text
49
51
  return "" unless choice
50
52
  if choice.text.is_a?(Symbol)
51
- receiver = (self.class)::CHOICE_ON == :object ? object : self
53
+ receiver = (self.class)::CHOICE_TEXT_MESSAGE_RECEIVER == :object ? object : self
52
54
  receiver.send(choice.text)
53
55
  else
54
56
  choice.text
@@ -1,3 +1,3 @@
1
1
  module StatusTag
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
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.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling