Class: ShowtimeInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/model/showtime_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(omelete_movie_id, obs, kind, time, theater) ⇒ ShowtimeInfo

Returns a new instance of ShowtimeInfo.



4
5
6
# File 'lib/model/showtime_info.rb', line 4

def initialize(omelete_movie_id, obs, kind, time, theater)
  self.omelete_movie_id, self.obs, self.kind, self.time, self.theater = omelete_movie_id, pretty_obs(obs), kind, time, theater
end

Instance Attribute Details

#kindObject

Returns the value of attribute kind.



2
3
4
# File 'lib/model/showtime_info.rb', line 2

def kind
  @kind
end

#obsObject

Returns the value of attribute obs.



2
3
4
# File 'lib/model/showtime_info.rb', line 2

def obs
  @obs
end

#omelete_movie_idObject

Returns the value of attribute omelete_movie_id.



2
3
4
# File 'lib/model/showtime_info.rb', line 2

def omelete_movie_id
  @omelete_movie_id
end

#theaterObject

Returns the value of attribute theater.



2
3
4
# File 'lib/model/showtime_info.rb', line 2

def theater
  @theater
end

#timeObject

Returns the value of attribute time.



2
3
4
# File 'lib/model/showtime_info.rb', line 2

def time
  @time
end

Instance Method Details

#pretty_obs(obs) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/model/showtime_info.rb', line 8

def pretty_obs(obs)
  if obs
    while obs.match(/\.[A-Z] | feriado[A-Z]/) do
      obs.insert(obs.index(/\.[A-Z]/) + 1, "\n") if obs.match(/\.[A-Z]/)
      obs.insert(obs.index(/feriado[A-Z]/) + 7, "\n") if obs.match(/feriado[A-Z]/)
    end
  end
  obs    
end