Class: Formation::Types::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/formation/types/text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field) ⇒ Text

Returns a new instance of Text.



5
6
7
# File 'lib/formation/types/text.rb', line 5

def initialize(field)
  @field = field
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



3
4
5
# File 'lib/formation/types/text.rb', line 3

def field
  @field
end

Instance Method Details

#to_htmlObject



9
10
11
12
13
# File 'lib/formation/types/text.rb', line 9

def to_html
  <<-HTML.strip
    <input type="text" name="#{field.name}" value="#{field.value}" />
  HTML
end