Class: Cure::Transformations
- Inherits:
-
Object
- Object
- Cure::Transformations
- Defined in:
- lib/cure/template/transformations.rb
Instance Attribute Summary collapse
- #candidates ⇒ Object
-
#placeholders ⇒ Object
TODO: make class Placeholder.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Transformations
constructor
A new instance of Transformations.
Constructor Details
#initialize ⇒ Transformations
Returns a new instance of Transformations.
12 13 14 15 |
# File 'lib/cure/template/transformations.rb', line 12 def initialize @candidates = [] @placeholders = {} end |
Instance Attribute Details
#candidates ⇒ Object
6 7 8 |
# File 'lib/cure/template/transformations.rb', line 6 def candidates @candidates end |
#placeholders ⇒ Object
TODO: make class Placeholder
10 11 12 |
# File 'lib/cure/template/transformations.rb', line 10 def placeholders @placeholders end |
Class Method Details
.from_hash(hash) ⇒ Cure::Transformations
19 20 21 22 23 24 |
# File 'lib/cure/template/transformations.rb', line 19 def self.from_hash(hash) this = Cure::Transformations.new this.candidates = hash["candidates"].map { |c| Cure::Transformation::Candidate.new.from_json(c) } this.placeholders = hash["placeholders"] this end |