Class: Yapt::Move
- Inherits:
-
Object
- Object
- Yapt::Move
- Defined in:
- lib/yapt/move.rb
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#to_move ⇒ Object
readonly
Returns the value of attribute to_move.
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
- #execute! ⇒ Object
-
#initialize(to_move, target) ⇒ Move
constructor
A new instance of Move.
- #params ⇒ Object
Constructor Details
permalink #initialize(to_move, target) ⇒ Move
Returns a new instance of Move.
10 11 12 |
# File 'lib/yapt/move.rb', line 10 def initialize(to_move, target) @to_move, @target = to_move, target end |
Instance Attribute Details
permalink #target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/yapt/move.rb', line 9 def target @target end |
permalink #to_move ⇒ Object (readonly)
Returns the value of attribute to_move.
9 10 11 |
# File 'lib/yapt/move.rb', line 9 def to_move @to_move end |
Class Method Details
Instance Method Details
permalink #description ⇒ Object
[View source]
14 15 16 |
# File 'lib/yapt/move.rb', line 14 def description "Move #{to_move.id} just above #{target.id}" end |
permalink #execute! ⇒ Object
[View source]
24 25 26 |
# File 'lib/yapt/move.rb', line 24 def execute! Request.new("stories/#{to_move.id}", params, :put).result end |
permalink #params ⇒ Object
[View source]
18 19 20 21 22 |
# File 'lib/yapt/move.rb', line 18 def params { before_id: target.id } end |