Class: RPaste::NoPaste::Metadata
- Includes:
- Comparable
- Defined in:
- lib/rpaste/nopaste/metadata.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Date of the paste.
-
#description ⇒ Object
Description of the paste.
-
#syntax ⇒ Object
Syntax of the paste text.
Attributes inherited from Metadata
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Compare self to another NoPaste Metadata object based on their respective dates.
-
#initialize(name, author, date, syntax, description, &block) ⇒ Metadata
constructor
Creates a new NoPaste Metadata object with the specified name, author, date, syntax and description.
-
#paste(opts = {}) ⇒ Object
Returns the NoPaste Paste object associated with the Metadata object.
Constructor Details
#initialize(name, author, date, syntax, description, &block) ⇒ Metadata
Creates a new NoPaste Metadata object with the specified name, author, date, syntax and description.
23 24 25 26 27 28 29 |
# File 'lib/rpaste/nopaste/metadata.rb', line 23 def initialize(name,,date,syntax,description,&block) @date = Time.parse(date) @syntax = syntax @description = description super(name,,&block) end |
Instance Attribute Details
#date ⇒ Object
Date of the paste
11 12 13 |
# File 'lib/rpaste/nopaste/metadata.rb', line 11 def date @date end |
#description ⇒ Object
Description of the paste
17 18 19 |
# File 'lib/rpaste/nopaste/metadata.rb', line 17 def description @description end |
#syntax ⇒ Object
Syntax of the paste text
14 15 16 |
# File 'lib/rpaste/nopaste/metadata.rb', line 14 def syntax @syntax end |
Instance Method Details
#<=>(other) ⇒ Object
Compare self to another NoPaste Metadata object based on their respective dates.
44 45 46 |
# File 'lib/rpaste/nopaste/metadata.rb', line 44 def <=>(other) @date <=> other.date end |