Class: Mb::Credentials
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ids ⇒ Object
Returns the value of attribute ids.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
-
#initialize(name = nil, password = nil, ids = []) ⇒ Credentials
constructor
Allow for Credentials.new to be used…
-
#to_hash ⇒ Object
Return a hash ready for inclusion in a savon SOAP request, allow instance variables to renamed dependent on a map set up in the class.
Methods inherited from Options
Constructor Details
#initialize(name = nil, password = nil, ids = []) ⇒ Credentials
Allow for Credentials.new to be used… and set at later
6 7 8 9 10 |
# File 'lib/mindbody/credentials.rb', line 6 def initialize(name = nil, password = nil, ids = []) @name = name @password = password arrayify ids, :ids end |
Instance Attribute Details
#ids ⇒ Object
Returns the value of attribute ids.
3 4 5 |
# File 'lib/mindbody/credentials.rb', line 3 def ids @ids end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/mindbody/credentials.rb', line 3 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/mindbody/credentials.rb', line 3 def password @password end |
Instance Method Details
#to_hash ⇒ Object
Return a hash ready for inclusion in a savon SOAP request, allow instance variables to renamed dependent on a map set up in the class
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mindbody/credentials.rb', line 14 def to_hash mapper = self.class.map || {} { mapper[:name] || "Name" => @name, mapper[:password] || "Password" => @password, mapper[:ids] || "Ids" => { "int" => @ids} } end |