Class: Lionel::ProxyAction
- Inherits:
-
Object
- Object
- Lionel::ProxyAction
- Extended by:
- Forwardable
- Defined in:
- lib/lionel/proxy_action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
- #board_id ⇒ Object
- #create? ⇒ Boolean
- #data_attributes(key) ⇒ Object
-
#initialize(action) ⇒ ProxyAction
constructor
A new instance of ProxyAction.
- #list_after ⇒ Object
- #list_after? ⇒ Boolean
- #list_before ⇒ Object
- #list_before? ⇒ Boolean
- #moved_to?(list_name) ⇒ Boolean
- #update? ⇒ Boolean
Constructor Details
#initialize(action) ⇒ ProxyAction
Returns a new instance of ProxyAction.
8 9 10 |
# File 'lib/lionel/proxy_action.rb', line 8 def initialize(action) @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/lionel/proxy_action.rb', line 5 def action @action end |
Instance Method Details
#board_id ⇒ Object
24 25 26 |
# File 'lib/lionel/proxy_action.rb', line 24 def board_id data_attributes("board")["id"] end |
#create? ⇒ Boolean
16 17 18 |
# File 'lib/lionel/proxy_action.rb', line 16 def create? type == "createCard" end |
#data_attributes(key) ⇒ Object
12 13 14 |
# File 'lib/lionel/proxy_action.rb', line 12 def data_attributes(key) data[key] || {} end |
#list_after ⇒ Object
28 29 30 |
# File 'lib/lionel/proxy_action.rb', line 28 def list_after data_attributes("listAfter") end |
#list_after? ⇒ Boolean
36 37 38 |
# File 'lib/lionel/proxy_action.rb', line 36 def list_after? list_after.any? end |
#list_before ⇒ Object
32 33 34 |
# File 'lib/lionel/proxy_action.rb', line 32 def list_before data_attributes("listBefore") end |
#list_before? ⇒ Boolean
40 41 42 |
# File 'lib/lionel/proxy_action.rb', line 40 def list_before? list_before.any? end |
#moved_to?(list_name) ⇒ Boolean
44 45 46 47 |
# File 'lib/lionel/proxy_action.rb', line 44 def moved_to?(list_name) return false unless list_after? !!(list_after["name"] =~ %r{^#{Regexp.escape(list_name.downcase)}}i) end |
#update? ⇒ Boolean
20 21 22 |
# File 'lib/lionel/proxy_action.rb', line 20 def update? type == "updateCard" end |