Class: Presto::Transformation
- Inherits:
-
Object
- Object
- Presto::Transformation
- Defined in:
- lib/presto/transformation.rb,
lib/presto/transformation/validator.rb
Defined Under Namespace
Classes: Validator
Constant Summary collapse
- DEFAULT_BG =
"#ffffff00"- DEFAULT_FIT =
'clip'
Instance Method Summary collapse
- #[](val) ⇒ Object
- #bg ⇒ Object
- #empty? ⇒ Boolean
- #fit ⇒ Object
- #fm ⇒ Object
- #h ⇒ Object
-
#initialize(params = {}) ⇒ Transformation
constructor
A new instance of Transformation.
- #q ⇒ Object
- #w ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Transformation
Returns a new instance of Transformation.
11 12 13 |
# File 'lib/presto/transformation.rb', line 11 def initialize params={} @params = params end |
Instance Method Details
#[](val) ⇒ Object
15 16 17 |
# File 'lib/presto/transformation.rb', line 15 def [] val send(val) end |
#bg ⇒ Object
19 20 21 |
# File 'lib/presto/transformation.rb', line 19 def bg params.key?(:bg) ? "##{params[:bg]}" : DEFAULT_BG end |
#empty? ⇒ Boolean
43 44 45 |
# File 'lib/presto/transformation.rb', line 43 def empty? params.empty? end |
#fit ⇒ Object
23 24 25 |
# File 'lib/presto/transformation.rb', line 23 def fit params[:fit] || DEFAULT_FIT end |
#fm ⇒ Object
27 28 29 |
# File 'lib/presto/transformation.rb', line 27 def fm params[:fm] end |
#h ⇒ Object
31 32 33 |
# File 'lib/presto/transformation.rb', line 31 def h params[:h].to_i if params.key?(:h) end |
#q ⇒ Object
39 40 41 |
# File 'lib/presto/transformation.rb', line 39 def q params[:q].to_i if params.key?(:q) end |
#w ⇒ Object
35 36 37 |
# File 'lib/presto/transformation.rb', line 35 def w params[:w].to_i if params.key?(:w) end |