Class: PR::Fields::StringField
- Inherits:
-
Object
- Object
- PR::Fields::StringField
- Defined in:
- lib/pr/fields/string_field.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #convert ⇒ Object
-
#initialize(value = '', options = {}) ⇒ StringField
constructor
A new instance of StringField.
- #populate(value) ⇒ Object
- #raw ⇒ Object
Constructor Details
#initialize(value = '', options = {}) ⇒ StringField
Returns a new instance of StringField.
5 6 7 |
# File 'lib/pr/fields/string_field.rb', line 5 def initialize value = '', = {} @value, @options = value, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/pr/fields/string_field.rb', line 8 def @options end |
Instance Method Details
#convert ⇒ Object
18 19 20 |
# File 'lib/pr/fields/string_field.rb', line 18 def convert @value.to_s end |
#populate(value) ⇒ Object
14 15 16 |
# File 'lib/pr/fields/string_field.rb', line 14 def populate value @value = value end |
#raw ⇒ Object
10 11 12 |
# File 'lib/pr/fields/string_field.rb', line 10 def raw @value end |