alter 0.0.1 → 0.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.
Files changed (4) hide show
  1. data/README.md +10 -0
  2. data/lib/alter.rb +1 -1
  3. data/lib/alter/version.rb +1 -1
  4. metadata +3 -3
data/README.md CHANGED
@@ -40,8 +40,16 @@ Now you can run that item through the processor by passing the `KumbayaProcessor
40
40
 
41
41
  <pre lang="ruby"><code>
42
42
  text.process KumbayaProcessor
43
+ text.value
43
44
  # result: "Your language is great"
44
45
  </code></pre>
46
+
47
+ Calling process returns the altered item. Items have the following attributes:
48
+
49
+ - `value` - the current value of the item
50
+ - `input` - the original input of the item
51
+ - `options` - the original options passed to the item
52
+ - `history` - a history of every item alteration
45
53
 
46
54
  You will also have access to any `options` passed to the processor. Here is a class making use of `options`.
47
55
 
@@ -58,6 +66,7 @@ end
58
66
 
59
67
  text = Alter::Item.new "Your language sucks", :age => 37
60
68
  text.process [KumbayaProcessor, EligibilityProcessor]
69
+ text.value
61
70
  # result: "Your language is great and you could run for President"
62
71
  </code></pre>
63
72
 
@@ -67,6 +76,7 @@ You can just as easily chain or separate these process calls. Options can also b
67
76
  text = Alter::Item.new "Your language sucks"
68
77
  text.process KumbayaProcessor
69
78
  text.process EligibilityProcessor, :age => 33
79
+ text.value
70
80
  # result: "Your language is great but you're too young to be President"
71
81
  </code></pre>
72
82
 
data/lib/alter.rb CHANGED
@@ -20,7 +20,7 @@ module Alter
20
20
  run_processor(processor.new(value, merged_options))
21
21
  end
22
22
 
23
- value
23
+ self
24
24
  end
25
25
 
26
26
  def run_processor(processor)
data/lib/alter/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Alter
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70266420215180 !ruby/object:Gem::Requirement
16
+ requirement: &70221407731100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70266420215180
24
+ version_requirements: *70221407731100
25
25
  description: Enforce structure by moving content filters to easy-to-write processor
26
26
  classes
27
27
  email: