Class: Gecko::Pusher::Channel::Rag

Inherits:
Base
  • Object
show all
Defined in:
lib/gecko-pusher/channel/rag.rb

Direct Known Subclasses

RagCol

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gecko::Pusher::Channel::Base

Instance Method Details

#push(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gecko-pusher/channel/rag.rb', line 6

def push(*args)
  data = if is_basic_rag?(*args)
    { item: [ { value: args[0], text: "" },
							{ value: args[1], text: "" },
							{ value: args[2], text: "" } ] }
         elsif is_basic_rag_with_descriptions?(*args)
    { item: [ { value: args[0], text: args[1] },
      { value: args[2], text: args[3]},
      { value: args[4], text: args[5]} ] }
  end
  _push(data)
end