Class: SemiFormal::Input

Inherits:
Object show all
Defined in:
lib/semi_formal/input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance, name) ⇒ Input

Returns a new instance of Input.



5
6
7
# File 'lib/semi_formal/input.rb', line 5

def initialize(instance, name)
  @instance, @name = instance, name
end

Instance Attribute Details

#instance ⇒ Object (readonly)

Returns the value of attribute instance.



3
4
5
# File 'lib/semi_formal/input.rb', line 3

def instance
  @instance
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/semi_formal/input.rb', line 3

def name
  @name
end

Instance Method Details

#call(builder) ⇒ Object



9
10
11
# File 'lib/semi_formal/input.rb', line 9

def call(builder)
  builder.input(:name => attr_name, :type => "text", :value => instance.send(name))
end