Class: Grid::Command
- Inherits:
-
Object
- Object
- Grid::Command
- Defined in:
- lib/grid/command.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(name, params) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(name, params) ⇒ Command
Returns a new instance of Command.
7 8 9 |
# File 'lib/grid/command.rb', line 7 def initialize(name, params) @name, @params = name, params end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/grid/command.rb', line 5 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/grid/command.rb', line 5 def params @params end |
Class Method Details
Instance Method Details
#encode ⇒ Object
24 25 26 27 28 29 |
# File 'lib/grid/command.rb', line 24 def encode JSON.unparse( :name => @name, :params => @params ) end |