Class: Calagator::VVenue

Inherits:
Struct
  • Object
show all
Defined in:
lib/calagator/vcalendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



83
84
85
86
87
88
# File 'lib/calagator/vcalendar.rb', line 83

def method_missing(method, *args, &block)
  vcard_hash_key = method.to_s.upcase
  return vcard_hash[vcard_hash_key] if vcard_hash.key?(vcard_hash_key)

  super
end

Instance Attribute Details

#raw_ical_venueObject

Returns the value of attribute raw_ical_venue

Returns:

  • (Object)

    the current value of raw_ical_venue



78
79
80
# File 'lib/calagator/vcalendar.rb', line 78

def raw_ical_venue
  @raw_ical_venue
end

Instance Method Details

#latitudeObject



95
96
97
# File 'lib/calagator/vcalendar.rb', line 95

def latitude
  geo_latlng.first
end

#longitudeObject



99
100
101
# File 'lib/calagator/vcalendar.rb', line 99

def longitude
  geo_latlng.last
end

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
93
# File 'lib/calagator/vcalendar.rb', line 90

def respond_to?(method, include_private = false)
  vcard_hash_key = method.to_s.upcase
  vcard_hash.key?(vcard_hash_key) || super
end

#uidObject



79
80
81
# File 'lib/calagator/vcalendar.rb', line 79

def uid
  raw_ical_venue.match(/^UID:(?<uid>.+)$/)[:uid]
end