Class: ASPSMS::Request::Abstract
- Inherits:
-
Object
- Object
- ASPSMS::Request::Abstract
- Includes:
- REXML
- Defined in:
- lib/aspsms.rb
Direct Known Subclasses
CheckOriginatorAuthorization, SendOriginatorUnlockCode, SendTextSMS, ShowCredits, UnlockOriginator
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#userkey ⇒ Object
Returns the value of attribute userkey.
Instance Method Summary collapse
-
#initialize(cfg) ⇒ Abstract
constructor
A new instance of Abstract.
- #to_s ⇒ Object
Constructor Details
#initialize(cfg) ⇒ Abstract
Returns a new instance of Abstract.
160 161 162 163 164 |
# File 'lib/aspsms.rb', line 160 def initialize(cfg) @cfg = cfg @userkey = @cfg.userkey @password = @cfg.password end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
158 159 160 |
# File 'lib/aspsms.rb', line 158 def password @password end |
#userkey ⇒ Object
Returns the value of attribute userkey.
158 159 160 |
# File 'lib/aspsms.rb', line 158 def userkey @userkey end |
Instance Method Details
#to_s ⇒ Object
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/aspsms.rb', line 166 def to_s doc = Document.new doc << REXML::XMLDecl.new('1.0', 'ISO-8859-1') root = Element.new('aspsms') root.elements.add(Element.new('Userkey'). add_text(@cfg.utf8(userkey))) root.elements.add(Element.new('Password'). add_text(@cfg.utf8(password))) each_element do |element| root.elements.add(element) end root.elements.add(Element.new('Action'). add_text(self.class.name.gsub(/^.*::/, ''))) doc << root doc.to_s end |