Class: GreenStripes::Album
- Inherits:
-
Object
- Object
- GreenStripes::Album
- Defined in:
- lib/greenstripes.rb,
ext/greenstripes/greenstripes.c
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#artist ⇒ nil
Returns the album’s artist.
-
#loaded? ⇒ Boolean
Returns true if the album is loaded, false otherwise.
-
#name ⇒ String?
Returns the album’s name.
- #to_link ⇒ Object
-
#year ⇒ Fixnum?
Returns the year the album was released.
Instance Method Details
#==(other) ⇒ Object
130 131 132 |
# File 'lib/greenstripes.rb', line 130 def ==(other) self.to_link == other.to_link end |
#artist ⇒ nil
Returns the album’s artist.
1015 1016 1017 1018 1019 1020 1021 |
# File 'ext/greenstripes/greenstripes.c', line 1015
static VALUE album_artist(VALUE self)
{
sp_album *album;
Data_Get_Struct(self, sp_album, album);
sp_artist *artist = sp_album_artist(album);
return artist ? Data_Wrap_Struct(class_artist, NULL, NULL, artist) : Qnil;
}
|
#loaded? ⇒ Boolean
Returns true if the album is loaded, false otherwise.
1003 1004 1005 1006 1007 1008 |
# File 'ext/greenstripes/greenstripes.c', line 1003
static VALUE album_loaded(VALUE self)
{
sp_album *album;
Data_Get_Struct(self, sp_album, album);
return sp_album_is_loaded(album) ? Qtrue : Qfalse;
}
|
#name ⇒ String?
Returns the album’s name.
1028 1029 1030 1031 1032 1033 1034 |
# File 'ext/greenstripes/greenstripes.c', line 1028
static VALUE album_name(VALUE self)
{
sp_album *album;
Data_Get_Struct(self, sp_album, album);
const char *name = sp_album_name(album);
return name ? rb_str_new2(name) : Qnil;
}
|
#year ⇒ Fixnum?
Returns the year the album was released.
1041 1042 1043 1044 1045 1046 1047 |
# File 'ext/greenstripes/greenstripes.c', line 1041
static VALUE album_year(VALUE self)
{
sp_album *album;
Data_Get_Struct(self, sp_album, album);
int year = sp_album_year(album);
return year ? INF2FIX(year) : Qnil;
}
|