class IcalImporter::LocalEvent

Constants

DAYS

Attributes

class_attributes[RW]

Public Class Methods

new(attributes) click to toggle source
# File lib/ical_importer/local_event.rb, line 37
def initialize(attributes)
  self.attributes = attributes
  @date_exclusions ||= []
end

Public Instance Methods

attributes()
Alias for: to_hash
attributes=(attributes) click to toggle source
# File lib/ical_importer/local_event.rb, line 53
def attributes=(attributes)
  attributes.each do |name, value|
    instance_variable_set "@#{name}", value if self.class.class_attributes.include? name.to_sym
  end
end
get_attributes(list) click to toggle source
# File lib/ical_importer/local_event.rb, line 42
def get_attributes(list)
  raise ArgumentError, "Must be an Array" unless list.is_a? Array
  list.collect! { |e| e.to_s }
  attributes.select { |k,_| list.include? k.to_s }
end
to_hash() click to toggle source
# File lib/ical_importer/local_event.rb, line 48
def to_hash
  Hash[*self.class.class_attributes.collect { |attribute| [attribute.to_sym, send(attribute)] }.flatten(1)]
end
Also aliased as: attributes