Module: Shove

Defined in:
lib/shove.rb,
lib/shove/app.rb,
lib/shove/protocol.rb,
lib/shove/http/request.rb,
lib/shove/app_directory.rb,
lib/shove/http/response.rb,
lib/shove/client/channel.rb,
lib/shove/client/callback.rb,
lib/shove/client/connection.rb,
lib/shove/http/client_context.rb,
lib/shove/http/channel_context.rb

Overview

Shove

See shove.io for an account and client documentation See github.com/shove/shove-ruby for gem documentation See github.com/shove/shove for js client documentation

Defined Under Namespace

Modules: Client, Http, Protocol Classes: App, AppDirectory, ShoveException

Constant Summary collapse

Version =
"1.0.7"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.appObject

Returns the value of attribute app.



27
28
29
# File 'lib/shove.rb', line 27

def app
  @app
end

.configObject

Returns the value of attribute config.



27
28
29
# File 'lib/shove.rb', line 27

def config
  @config
end

Class Method Details

.channel(name) ⇒ Object

fetch a channel by name name the name of the channel



57
58
59
# File 'lib/shove.rb', line 57

def channel name
  @app.channel(name)
end

.channel_key(channel) ⇒ Object

Create a channel key channel the name of the channel



86
87
88
# File 'lib/shove.rb', line 86

def channel_key channel
  @app.channel_key channel
end

.client(id) ⇒ Object

fetch a client by id



62
63
64
# File 'lib/shove.rb', line 62

def client id
  @app.client(id)
end

.configure(params = nil, &block) ⇒ Object

configure shover settings the settings for the created client as a string for a yaml file, or as a hash



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/shove.rb', line 32

def configure params=nil, &block

  unless defined? @config
    @config = Confstruct::Configuration.new do
      api_url "https://api.shove.io"
    end
  end
  
  if params
    @config.configure params
  end

  if block
    @config.configure(&block)
  end

  unless defined? @app
    @app = App.new(@config)
  else
    
  end
end

.connectObject

Connect to the default app with a WebSocket connection



80
81
82
# File 'lib/shove.rb', line 80

def connect
  @app.connect
end

.hostsObject

fetch the available stream nodes for this network.



74
75
76
# File 'lib/shove.rb', line 74

def hosts
  @app.hosts
end

.valid?Boolean

validate network settings used for the CLI

Returns:

  • (Boolean)


68
69
70
# File 'lib/shove.rb', line 68

def valid?
  @app.valid?
end