Class: SML::GetList::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-sml/sml-getlist.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, server_id, username, password, list_name) ⇒ Request

Returns a new instance of Request.



12
13
14
15
16
17
18
# File 'lib/ruby-sml/sml-getlist.rb', line 12

def initialize(client_id, server_id, username, password, list_name)
  @client_id = client_id
  @server_id = server_id
  @username = username
  @password = password
  @list_name = list_name
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



10
11
12
# File 'lib/ruby-sml/sml-getlist.rb', line 10

def client_id
  @client_id
end

#list_nameObject

Returns the value of attribute list_name.



10
11
12
# File 'lib/ruby-sml/sml-getlist.rb', line 10

def list_name
  @list_name
end

#passwordObject

Returns the value of attribute password.



10
11
12
# File 'lib/ruby-sml/sml-getlist.rb', line 10

def password
  @password
end

#server_idObject

Returns the value of attribute server_id.



10
11
12
# File 'lib/ruby-sml/sml-getlist.rb', line 10

def server_id
  @server_id
end

#usernameObject

Returns the value of attribute username.



10
11
12
# File 'lib/ruby-sml/sml-getlist.rb', line 10

def username
  @username
end

Class Method Details

.construct(array_rep) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/ruby-sml/sml-getlist.rb', line 20

def self.construct(array_rep)
  return nil if array_rep.nil?
  client_id = array_rep.shift
  server_id = array_rep.shift
  username = array_rep.shift
  password = array_rep.shift
  list_name = array_rep.shift

  return SML::GetList::Request.new(client_id, server_id, username, password, list_name)
end

.pconstrut(o = {}) ⇒ Object



31
32
33
# File 'lib/ruby-sml/sml-getlist.rb', line 31

def self.pconstrut(o={})
  return SML::GetList::Request.new(o[:client_id], o[:server_id], o[:username], o[:password], o[:list_name])
end

Instance Method Details

#to_aObject



35
36
37
# File 'lib/ruby-sml/sml-getlist.rb', line 35

def to_a
  return [] << client_id << server_id << username << password << list_name
end