Class: BootstrapFormBuilder::ParsedArgs
- Inherits:
-
Object
- Object
- BootstrapFormBuilder::ParsedArgs
- Defined in:
- lib/bootstrap_form_builder/form_builder.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
Returns the value of attribute classes.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ParsedArgs
constructor
A new instance of ParsedArgs.
- #options ⇒ Object
- #shift ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(*args) ⇒ ParsedArgs
69 70 71 72 73 |
# File 'lib/bootstrap_form_builder/form_builder.rb', line 69 def initialize(*args) = args. @args = args @classes = StringList.new(.delete(:class)) end |
Instance Attribute Details
#classes ⇒ Object
Returns the value of attribute classes.
67 68 69 |
# File 'lib/bootstrap_form_builder/form_builder.rb', line 67 def classes @classes end |
Instance Method Details
#options ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/bootstrap_form_builder/form_builder.rb', line 75 def if @classes.empty? else .merge(class: @classes.to_s) end end |
#shift ⇒ Object
83 84 85 |
# File 'lib/bootstrap_form_builder/form_builder.rb', line 83 def shift @args.shift end |
#to_a ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/bootstrap_form_builder/form_builder.rb', line 87 def to_a if @classes.empty? && .empty? @args else @args + [] end end |