Class: Hurley::Query::Pair

Inherits:
Struct
  • Object
show all
Defined in:
lib/hurley/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#escaped_keyObject

Returns the value of attribute escaped_key

Returns:

  • (Object)

    the current value of escaped_key



176
177
178
# File 'lib/hurley/query.rb', line 176

def escaped_key
  @escaped_key
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



176
177
178
# File 'lib/hurley/query.rb', line 176

def key
  @key
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



176
177
178
# File 'lib/hurley/query.rb', line 176

def value
  @value
end

Instance Method Details

#to_sObject



177
178
179
180
181
182
183
# File 'lib/hurley/query.rb', line 177

def to_s
  if value
    "#{escaped_key}=#{Url.escape_path(value)}"
  else
    escaped_key
  end
end