Class: Fugle::HTTP::Parameters Private
- Inherits:
-
Object
- Object
- Fugle::HTTP::Parameters
- Defined in:
- lib/fugle/http/parameters.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #[](name) ⇒ Object private
- #add(name, options = {}) ⇒ Object private
-
#initialize ⇒ Parameters
constructor
private
A new instance of Parameters.
- #requires ⇒ Object private
Constructor Details
#initialize ⇒ Parameters
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Parameters.
10 11 12 |
# File 'lib/fugle/http/parameters.rb', line 10 def initialize @items = [] end |
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/fugle/http/parameters.rb', line 33 def [](name) @items.find { |item| item[:name] == name } end |
#add(name, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 |
# File 'lib/fugle/http/parameters.rb', line 16 def add(name, = {}) @items.push( name: name.to_sym, required: [:required] == true, alias: [:alias] ) end |
#requires ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 |
# File 'lib/fugle/http/parameters.rb', line 26 def requires @requires ||= @items.select { |item| item[:required] } end |