Class: SemiFormal::Input
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call(builder) ⇒ Object
-
#initialize(instance, name) ⇒ Input
constructor
A new instance of Input.
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 |