struct Music
- Music
- Struct
- Value
- Object
Included Modules
- JSON::Serializable
Defined in:
models/music.crConstructors
- .new(name : String, artist : String, length : Float64, *, album : Nil | String = nil)
- .new(pull : JSON::PullParser)
Instance Method Summary
-
#album : String | Nil
@id : String = UUID.random.to_s
-
#artist : String
@id : String = UUID.random.to_s
- #favorite : Bool
- #favorite=(favorite : Bool)
-
#id : String
@id : String = UUID.random.to_s
-
#length : Float64
@id : String = UUID.random.to_s
- #name : String
- #name=(name : String)
-
#to_s : String
Returns a nicely readable and concise string representation of this object, typically intended for users.
Constructor Detail
def self.new(name : String, artist : String, length : Float64, *, album : Nil | String = nil)
#
Instance Method Detail
def to_s : String
#
Description copied from class Object
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO)
which can be overridden for custom implementations.
Also see #inspect
.