Class: Mb::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/mindbody/options.rb

Direct Known Subclasses

Credentials, StaffOptions

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.mapObject

Returns the value of attribute map.



3
4
5
# File 'lib/mindbody/options.rb', line 3

def map
  @map
end

Class Method Details

.public_var_names(soap_names_map) ⇒ Object

A map describing how the local private instance variables should show for public services



6
7
8
# File 'lib/mindbody/options.rb', line 6

def self.public_var_names(soap_names_map)
	@map = soap_names_map
end

Instance Method Details

#arrayify(arr, attr_sym = nil) ⇒ Object

Check that a variable is an Array, if not turn it into one If a symbol is given as a second option, assume the sym is the name of a instance variable, send the instance_variable to value of its new attr (Array) NOTE: Should not give sym as option if defining the attribute method for the same name attribute, will cause infinite loop. Mostly this option is for use within initialize method



18
19
20
21
22
23
24
25
26
# File 'lib/mindbody/options.rb', line 18

def arrayify(arr, attr_sym = nil)
	begin
		arr.count #Is this an array?
	rescue
		arr = [arr]
	end		

	attr_sym ? send(attr_sym.to_s + "=", arr) : arr
end