Class: Active::Services::IActivity

Inherits:
Object
  • Object
show all
Defined in:
lib/services/IActivity.rb

Direct Known Subclasses

ATS, ActiveWorks, Activity, GSA, RegCenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def address
  @address
end

#asset_idObject

Returns the value of attribute asset_id.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def asset_id
  @asset_id
end

#asset_type_idObject

Returns the value of attribute asset_type_id.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def asset_type_id
  @asset_type_id
end

#categoriesObject

Returns the value of attribute categories.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def categories
  @categories
end

#categoryObject

Returns the value of attribute category.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def category
  @category
end

#dataObject

Returns the value of attribute data.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def data
  @data
end

#descObject

Returns the value of attribute desc.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def desc
  @desc
end

#end_dateObject

Returns the value of attribute end_date.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def end_date
  @end_date
end

#end_timeObject

Returns the value of attribute end_time.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def end_time
  @end_time
end

#online_registrationObject

Returns the value of attribute online_registration.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def online_registration
  @online_registration
end

#start_dateObject

Returns the value of attribute start_date.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def start_date
  @start_date
end

#start_timeObject

Returns the value of attribute start_time.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def start_time
  @start_time
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def title
  @title
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/services/IActivity.rb', line 10

def url
  @url
end

Instance Method Details

#sourceObject

Raises:

  • (StandardError)


31
32
33
# File 'lib/services/IActivity.rb', line 31

def source
  raise StandardError, "You must override this method"
end

#validated_address(address) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/services/IActivity.rb', line 15

def validated_address(address)
  #ensure a hash with the proper keys
  returnAddress = HashWithIndifferentAccess.new({ :name =>"", :address => "", :city => "", :state => "",:zip => "", :lat => "", :lng => "", :country => ""})
  returnAddress.merge!(address)
  # validations

  returnAddress["zip"] = Validators.valid_zip(returnAddress["zip"])
  returnAddress["state"] = Validators.valid_state(returnAddress["state"])

  # ensure no nil
  returnAddress.keys.each do |key|
    returnAddress[key] = "" if returnAddress[key].nil?
  end
  returnAddress
end