Class: Ippon::FormData::BracketKey
- Inherits:
-
Object
- Object
- Ippon::FormData::BracketKey
- Defined in:
- lib/ippon/form_data.rb
Overview
Instance Method Summary collapse
-
#[](name) ⇒ Object
Creates a new subkey with a given name.
-
#initialize(value = "") ⇒ BracketKey
constructor
Creates a new key.
-
#to_s ⇒ Object
Returns the full string representation.
Constructor Details
#initialize(value = "") ⇒ BracketKey
Creates a new key.
43 44 45 |
# File 'lib/ippon/form_data.rb', line 43 def initialize(value = "") @value = value.to_s end |
Instance Method Details
#[](name) ⇒ Object
Creates a new subkey with a given name.
53 54 55 56 57 58 59 |
# File 'lib/ippon/form_data.rb', line 53 def [](name) if @value.empty? BracketKey.new(name) else BracketKey.new("#{@value}[#{name}]") end end |
#to_s ⇒ Object
Returns the full string representation.
48 49 50 |
# File 'lib/ippon/form_data.rb', line 48 def to_s @value end |