Class: PR::Fields::StringField

Inherits:
Object
  • Object
show all
Defined in:
lib/pr/fields/string_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = '', options = {}
  @value, @options = value, options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/pr/fields/string_field.rb', line 8

def options
  @options
end

Instance Method Details

#convertObject



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

#rawObject



10
11
12
# File 'lib/pr/fields/string_field.rb', line 10

def raw
  @value
end