Class: Ippon::FormData::DotKey
- Inherits:
-
Object
- Object
- Ippon::FormData::DotKey
- Defined in:
- lib/ippon/form_data.rb
Overview
Instance Method Summary collapse
-
#[](name) ⇒ Object
Creates a new subkey with a given name.
-
#initialize(value = "") ⇒ DotKey
constructor
Creates a new key.
-
#to_s ⇒ Object
Returns the full string representation.
Constructor Details
#initialize(value = "") ⇒ DotKey
Creates a new key.
15 16 17 |
# File 'lib/ippon/form_data.rb', line 15 def initialize(value = "") @value = value.to_s end |
Instance Method Details
#[](name) ⇒ Object
Creates a new subkey with a given name.
25 26 27 28 29 30 31 |
# File 'lib/ippon/form_data.rb', line 25 def [](name) if @value.empty? DotKey.new(name) else DotKey.new("#{@value}.#{name}") end end |
#to_s ⇒ Object
Returns the full string representation.
20 21 22 |
# File 'lib/ippon/form_data.rb', line 20 def to_s @value end |