Class: Mycommands::Params
- Inherits:
-
Object
- Object
- Mycommands::Params
- Includes:
- Enumerable
- Defined in:
- lib/mycommands/models/param.rb
Instance Attribute Summary collapse
-
#current_param_index ⇒ Object
readonly
Returns the value of attribute current_param_index.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #all_substituted? ⇒ Boolean
- #current_param ⇒ Object
- #each ⇒ Object
-
#initialize(params) ⇒ Params
constructor
A new instance of Params.
- #next_param ⇒ Object
Constructor Details
Instance Attribute Details
#current_param_index ⇒ Object (readonly)
Returns the value of attribute current_param_index.
4 5 6 |
# File 'lib/mycommands/models/param.rb', line 4 def current_param_index @current_param_index end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
4 5 6 |
# File 'lib/mycommands/models/param.rb', line 4 def param @param end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/mycommands/models/param.rb', line 4 def params @params end |
Instance Method Details
#all_substituted? ⇒ Boolean
18 19 20 |
# File 'lib/mycommands/models/param.rb', line 18 def all_substituted? @current_param_index == @params.size end |
#current_param ⇒ Object
10 11 12 |
# File 'lib/mycommands/models/param.rb', line 10 def current_param @params.reverse[@current_param_index] end |
#each ⇒ Object
22 23 24 25 26 |
# File 'lib/mycommands/models/param.rb', line 22 def each for p in @params do yield p end end |
#next_param ⇒ Object
14 15 16 |
# File 'lib/mycommands/models/param.rb', line 14 def next_param @current_param_index += 1 end |