Class: Rocx::Properties::Expansion
- Inherits:
-
ValueProperty
- Object
- BaseProperty
- ValueProperty
- Rocx::Properties::Expansion
- Defined in:
- lib/rocx/properties/expansion.rb
Instance Attribute Summary
Attributes inherited from ValueProperty
Attributes inherited from BaseProperty
Instance Method Summary collapse
Methods inherited from ValueProperty
#initialize, #render?, #to_xml
Methods inherited from BaseProperty
#default_name, #default_tag, name, #name, #render?, tag, #tag
Constructor Details
This class inherits a constructor from Rocx::Properties::ValueProperty
Instance Method Details
#invalid_message ⇒ Object
12 13 14 |
# File 'lib/rocx/properties/expansion.rb', line 12 def "Invalid #{name}: value must be a percentage greater than 0 or less than 601" end |
#valid? ⇒ Boolean
6 7 8 9 10 |
# File 'lib/rocx/properties/expansion.rb', line 6 def valid? return false unless value =~ /(\d{1,3})%/ percentage = $1.to_i percentage >= 1 && percentage <= 600 end |