Class: GtkGimdb::MovieBox

Inherits:
Gtk::VBox
  • Object
show all
Includes:
GetText
Defined in:
lib/gimdb/movie_box.rb

Defined Under Namespace

Classes: UserCheckButton

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (MovieBox) initialize(movie, users = [])

A new instance of MovieBox



8
9
10
11
12
13
14
15
# File 'lib/gimdb/movie_box.rb', line 8

def initialize(movie, users = [])
  bindtextdomain($DOMAIN, $LOCALEDIR, nil, 'UTF-8')
  super()
  @movie = movie
  @users = users
  setting_up
  self.show_all
end

Instance Attribute Details

- (Object) movie (readonly)

Returns the value of attribute movie



5
6
7
# File 'lib/gimdb/movie_box.rb', line 5

def movie
  @movie
end

Instance Method Details

- (Boolean) has_poster?

Returns:

  • (Boolean)


17
18
19
# File 'lib/gimdb/movie_box.rb', line 17

def has_poster?
  @movie.image_path && File.exist?(@movie.image_path)
end

- (Object) set_poster



21
22
23
# File 'lib/gimdb/movie_box.rb', line 21

def set_poster
  @img.file = @movie.image_path if has_poster?      
end