Class: EndiciaLabelServer::Parsers::UserSignUpParser

Inherits:
ParserBase
  • Object
show all
Defined in:
lib/endicia_label_server/parsers/user_sign_up_parser.rb

Instance Attribute Summary collapse

Attributes inherited from ParserBase

#error_description, #status_code, #switches

Instance Method Summary collapse

Methods inherited from ParserBase

#element_tracker_switch, #end_element, #initialize, #start_element, #switch_active?

Constructor Details

This class inherits a constructor from EndiciaLabelServer::Parsers::ParserBase

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id


4
5
6
# File 'lib/endicia_label_server/parsers/user_sign_up_parser.rb', line 4

def 
  @account_id
end

#confirmation_numberObject

Returns the value of attribute confirmation_number


4
5
6
# File 'lib/endicia_label_server/parsers/user_sign_up_parser.rb', line 4

def confirmation_number
  @confirmation_number
end

#tokenObject

Returns the value of attribute token


4
5
6
# File 'lib/endicia_label_server/parsers/user_sign_up_parser.rb', line 4

def token
  @token
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'lib/endicia_label_server/parsers/user_sign_up_parser.rb', line 19

def success?
  !['0', 0].include? confirmation_number
end

#value(value) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/endicia_label_server/parsers/user_sign_up_parser.rb', line 6

def value(value)
  super

  string_value = value.as_s
  if switch_active? :ConfirmationNumber
    self.confirmation_number = string_value
  elsif switch_active? :AccountID
    self. = string_value
  elsif switch_active? :Token
    self.token = string_value
  end
end