Class: Calagator::VVenue

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

Constant Summary collapse

VCARD_LINES_RE =
/^(?<key>[^;]+?)(?<qualifier>;[^:]*?)?:(?<value>.*)$/.freeze

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



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

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



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

def latitude
  geo_latlng.first
end

#longitudeObject



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

def longitude
  geo_latlng.last
end

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

Returns:

  • (Boolean)


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

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

#uidObject



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

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