Class: MasonClient::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/mason_client/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo, ref, command, callback) ⇒ Request

Returns a new instance of Request.



3
4
5
6
7
8
# File 'lib/mason_client/request.rb', line 3

def initialize(repo, ref, command, callback)
  @repo     = repo
  @ref      = ref
  @command  = command
  @callback = callback
end

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



10
11
12
# File 'lib/mason_client/request.rb', line 10

def callback
  @callback
end

#commandObject (readonly)

Returns the value of attribute command.



10
11
12
# File 'lib/mason_client/request.rb', line 10

def command
  @command
end

#refObject (readonly)

Returns the value of attribute ref.



10
11
12
# File 'lib/mason_client/request.rb', line 10

def ref
  @ref
end

#repoObject (readonly)

Returns the value of attribute repo.



10
11
12
# File 'lib/mason_client/request.rb', line 10

def repo
  @repo
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
# File 'lib/mason_client/request.rb', line 12

def to_json
  { :repo     => repo,
    :ref      => ref,
    :command  => command,
    :callback => callback }.to_json
end