taskjuggler 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +280 -0
- data/README +31 -0
- data/Rakefile +20 -0
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/benchmarks/allocate.tjp +30 -0
- data/benchmarks/booking.tjp +62 -0
- data/benchmarks/depends.tjp +112 -0
- data/benchmarks/htmltaskreport.tjp +45 -0
- data/benchmarks/runbench.rb +24 -0
- data/bin/tj3 +3 -0
- data/bin/tj3man +3 -0
- data/doc/classes/AppConfig.html +808 -0
- data/doc/classes/Arguments.html +226 -0
- data/doc/classes/String.html +395 -0
- data/doc/classes/TaskJuggler.html +1358 -0
- data/doc/classes/TaskJuggler/Account.html +257 -0
- data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
- data/doc/classes/TaskJuggler/Allocation.html +419 -0
- data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
- data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
- data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
- data/doc/classes/TaskJuggler/Booking.html +307 -0
- data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
- data/doc/classes/TaskJuggler/CSVFile.html +325 -0
- data/doc/classes/TaskJuggler/Charge.html +279 -0
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
- data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
- data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
- data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
- data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
- data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
- data/doc/classes/TaskJuggler/GanttChart.html +667 -0
- data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
- data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
- data/doc/classes/TaskJuggler/GanttLine.html +398 -0
- data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
- data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
- data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
- data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
- data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
- data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
- data/doc/classes/TaskJuggler/Interval.html +552 -0
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
- data/doc/classes/TaskJuggler/Limits.html +416 -0
- data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
- data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/Log.html +613 -0
- data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
- data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
- data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
- data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
- data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
- data/doc/classes/TaskJuggler/Macro.html +194 -0
- data/doc/classes/TaskJuggler/MacroParser.html +360 -0
- data/doc/classes/TaskJuggler/MacroTable.html +366 -0
- data/doc/classes/TaskJuggler/Message.html +281 -0
- data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
- data/doc/classes/TaskJuggler/Project.html +1606 -0
- data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
- data/doc/classes/TaskJuggler/PropertyList.html +597 -0
- data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
- data/doc/classes/TaskJuggler/Query.html +600 -0
- data/doc/classes/TaskJuggler/RealFormat.html +252 -0
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
- data/doc/classes/TaskJuggler/Report.html +528 -0
- data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
- data/doc/classes/TaskJuggler/ReportTable.html +497 -0
- data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
- data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
- data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
- data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
- data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
- data/doc/classes/TaskJuggler/Resource.html +211 -0
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
- data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
- data/doc/classes/TaskJuggler/RichText.html +537 -0
- data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
- data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
- data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
- data/doc/classes/TaskJuggler/RichTextException.html +212 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
- data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
- data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
- data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
- data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
- data/doc/classes/TaskJuggler/Scenario.html +163 -0
- data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
- data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
- data/doc/classes/TaskJuggler/Shift.html +255 -0
- data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
- data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
- data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
- data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
- data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
- data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
- data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
- data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
- data/doc/classes/TaskJuggler/Task.html +203 -0
- data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
- data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
- data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
- data/doc/classes/TaskJuggler/TextParser.html +670 -0
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
- data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
- data/doc/classes/TaskJuggler/TextScanner.html +708 -0
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
- data/doc/classes/TaskJuggler/TjException.html +185 -0
- data/doc/classes/TaskJuggler/TjTime.html +1845 -0
- data/doc/classes/TaskJuggler/TjpExample.html +310 -0
- data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
- data/doc/classes/TaskJuggler/UserManual.html +606 -0
- data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
- data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
- data/doc/classes/TaskJuggler/XMLComment.html +206 -0
- data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
- data/doc/classes/TaskJuggler/XMLElement.html +341 -0
- data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
- data/doc/classes/TaskJuggler/XMLText.html +221 -0
- data/doc/files/COPYING.html +448 -0
- data/doc/files/README.html +134 -0
- data/doc/files/lib/AccountScenario_rb.html +116 -0
- data/doc/files/lib/Account_rb.html +118 -0
- data/doc/files/lib/Allocation_rb.html +118 -0
- data/doc/files/lib/AppConfig_rb.html +116 -0
- data/doc/files/lib/AttributeBase_rb.html +106 -0
- data/doc/files/lib/AttributeDefinition_rb.html +106 -0
- data/doc/files/lib/Attributes_rb.html +130 -0
- data/doc/files/lib/Booking_rb.html +106 -0
- data/doc/files/lib/ChargeSet_rb.html +116 -0
- data/doc/files/lib/Charge_rb.html +116 -0
- data/doc/files/lib/HTMLDocument_rb.html +116 -0
- data/doc/files/lib/Interval_rb.html +116 -0
- data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
- data/doc/files/lib/Limits_rb.html +116 -0
- data/doc/files/lib/Log_rb.html +116 -0
- data/doc/files/lib/LogicalExpression_rb.html +122 -0
- data/doc/files/lib/LogicalFlag_rb.html +116 -0
- data/doc/files/lib/LogicalFunction_rb.html +116 -0
- data/doc/files/lib/LogicalOperation_rb.html +116 -0
- data/doc/files/lib/MacroParser_rb.html +118 -0
- data/doc/files/lib/MacroTable_rb.html +122 -0
- data/doc/files/lib/MessageHandler_rb.html +106 -0
- data/doc/files/lib/Message_rb.html +116 -0
- data/doc/files/lib/ProjectFileParser_rb.html +122 -0
- data/doc/files/lib/Project_rb.html +148 -0
- data/doc/files/lib/PropertyList_rb.html +106 -0
- data/doc/files/lib/PropertySet_rb.html +118 -0
- data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
- data/doc/files/lib/Query_rb.html +116 -0
- data/doc/files/lib/RealFormat_rb.html +106 -0
- data/doc/files/lib/ResourceScenario_rb.html +116 -0
- data/doc/files/lib/Resource_rb.html +118 -0
- data/doc/files/lib/RichTextDocument_rb.html +120 -0
- data/doc/files/lib/RichTextElement_rb.html +120 -0
- data/doc/files/lib/RichTextParser_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
- data/doc/files/lib/RichTextScanner_rb.html +116 -0
- data/doc/files/lib/RichTextSnip_rb.html +118 -0
- data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
- data/doc/files/lib/RichText_rb.html +118 -0
- data/doc/files/lib/ScenarioData_rb.html +118 -0
- data/doc/files/lib/Scenario_rb.html +116 -0
- data/doc/files/lib/Scoreboard_rb.html +106 -0
- data/doc/files/lib/ShiftAssignments_rb.html +116 -0
- data/doc/files/lib/ShiftScenario_rb.html +116 -0
- data/doc/files/lib/Shift_rb.html +118 -0
- data/doc/files/lib/SourceFileInfo_rb.html +106 -0
- data/doc/files/lib/SyntaxReference_rb.html +122 -0
- data/doc/files/lib/TOCEntry_rb.html +118 -0
- data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
- data/doc/files/lib/TableOfContents_rb.html +118 -0
- data/doc/files/lib/TaskDependency_rb.html +106 -0
- data/doc/files/lib/TaskJuggler_rb.html +120 -0
- data/doc/files/lib/TaskScenario_rb.html +116 -0
- data/doc/files/lib/Task_rb.html +118 -0
- data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
- data/doc/files/lib/TextParser/Rule_rb.html +106 -0
- data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
- data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
- data/doc/files/lib/TextParser_rb.html +124 -0
- data/doc/files/lib/TextScanner_rb.html +128 -0
- data/doc/files/lib/Tj3Config_rb.html +118 -0
- data/doc/files/lib/TjException_rb.html +106 -0
- data/doc/files/lib/TjTime_rb.html +118 -0
- data/doc/files/lib/TjpExample_rb.html +116 -0
- data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
- data/doc/files/lib/UTF8String_rb.html +132 -0
- data/doc/files/lib/UserManual_rb.html +124 -0
- data/doc/files/lib/WorkingHours_rb.html +116 -0
- data/doc/files/lib/XMLDocument_rb.html +116 -0
- data/doc/files/lib/XMLElement_rb.html +116 -0
- data/doc/files/lib/reports/CSVFile_rb.html +116 -0
- data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
- data/doc/files/lib/reports/GanttChart_rb.html +122 -0
- data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
- data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
- data/doc/files/lib/reports/GanttLine_rb.html +126 -0
- data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
- data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
- data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
- data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
- data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
- data/doc/files/lib/reports/ReportElement_rb.html +118 -0
- data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
- data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
- data/doc/files/lib/reports/ReportTable_rb.html +118 -0
- data/doc/files/lib/reports/Report_rb.html +126 -0
- data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
- data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
- data/doc/files/lib/taskjuggler3_rb.html +276 -0
- data/doc/files/lib/tj3man_rb.html +189 -0
- data/doc/fr_class_index.html +285 -0
- data/doc/fr_file_index.html +223 -0
- data/doc/fr_method_index.html +1953 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples/tutorial.tjp +361 -0
- data/gem_spec.rb +30 -0
- data/lib/Account.rb +50 -0
- data/lib/AccountScenario.rb +39 -0
- data/lib/Allocation.rb +102 -0
- data/lib/AppConfig.rb +134 -0
- data/lib/AttributeBase.rb +131 -0
- data/lib/AttributeDefinition.rb +47 -0
- data/lib/Attributes.rb +478 -0
- data/lib/BatchProcessor.rb +209 -0
- data/lib/Booking.rb +59 -0
- data/lib/Charge.rb +71 -0
- data/lib/ChargeSet.rb +126 -0
- data/lib/HTMLDocument.rb +59 -0
- data/lib/Interval.rb +127 -0
- data/lib/KeywordDocumentation.rb +560 -0
- data/lib/Limits.rb +219 -0
- data/lib/Log.rb +160 -0
- data/lib/LogicalExpression.rb +71 -0
- data/lib/LogicalFlag.rb +34 -0
- data/lib/LogicalFunction.rb +102 -0
- data/lib/LogicalOperation.rb +118 -0
- data/lib/MacroParser.rb +77 -0
- data/lib/MacroTable.rb +84 -0
- data/lib/Message.rb +56 -0
- data/lib/MessageHandler.rb +34 -0
- data/lib/Project.rb +662 -0
- data/lib/ProjectFileParser.rb +333 -0
- data/lib/PropertyList.rb +181 -0
- data/lib/PropertySet.rb +304 -0
- data/lib/PropertyTreeNode.rb +461 -0
- data/lib/Query.rb +227 -0
- data/lib/RealFormat.rb +73 -0
- data/lib/Resource.rb +42 -0
- data/lib/ResourceScenario.rb +511 -0
- data/lib/RichText.rb +147 -0
- data/lib/RichTextDocument.rb +139 -0
- data/lib/RichTextElement.rb +391 -0
- data/lib/RichTextParser.rb +66 -0
- data/lib/RichTextProtocolExample.rb +65 -0
- data/lib/RichTextProtocolHandler.rb +35 -0
- data/lib/RichTextScanner.rb +390 -0
- data/lib/RichTextSnip.rb +104 -0
- data/lib/RichTextSyntaxRules.rb +265 -0
- data/lib/Scenario.rb +27 -0
- data/lib/ScenarioData.rb +65 -0
- data/lib/Scoreboard.rb +141 -0
- data/lib/Shift.rb +48 -0
- data/lib/ShiftAssignments.rb +291 -0
- data/lib/ShiftScenario.rb +46 -0
- data/lib/SourceFileInfo.rb +37 -0
- data/lib/SyntaxReference.rb +284 -0
- data/lib/TOCEntry.rb +76 -0
- data/lib/TableColumnDefinition.rb +54 -0
- data/lib/TableOfContents.rb +46 -0
- data/lib/Task.rb +37 -0
- data/lib/TaskDependency.rb +39 -0
- data/lib/TaskJuggler.rb +84 -0
- data/lib/TaskScenario.rb +1622 -0
- data/lib/TextParser.rb +416 -0
- data/lib/TextParser/Pattern.rb +263 -0
- data/lib/TextParser/Rule.rb +171 -0
- data/lib/TextParser/StackElement.rb +45 -0
- data/lib/TextParser/TokenDoc.rb +38 -0
- data/lib/TextScanner.rb +682 -0
- data/lib/Tj3Config.rb +27 -0
- data/lib/TjException.rb +27 -0
- data/lib/TjTime.rb +395 -0
- data/lib/TjpExample.rb +119 -0
- data/lib/TjpSyntaxRules.rb +4022 -0
- data/lib/UTF8String.rb +100 -0
- data/lib/UserManual.rb +282 -0
- data/lib/WorkingHours.rb +323 -0
- data/lib/XMLDocument.rb +54 -0
- data/lib/XMLElement.rb +175 -0
- data/lib/reports/CSVFile.rb +146 -0
- data/lib/reports/ColumnTable.rb +66 -0
- data/lib/reports/GanttChart.rb +308 -0
- data/lib/reports/GanttContainer.rb +107 -0
- data/lib/reports/GanttHeader.rb +141 -0
- data/lib/reports/GanttHeaderScaleItem.rb +42 -0
- data/lib/reports/GanttLine.rb +329 -0
- data/lib/reports/GanttLoadStack.rb +113 -0
- data/lib/reports/GanttMilestone.rb +80 -0
- data/lib/reports/GanttRouter.rb +375 -0
- data/lib/reports/GanttTaskBar.rb +95 -0
- data/lib/reports/HTMLGraphics.rb +65 -0
- data/lib/reports/Report.rb +344 -0
- data/lib/reports/ReportElement.rb +427 -0
- data/lib/reports/ReportTable.rb +144 -0
- data/lib/reports/ReportTableCell.rb +142 -0
- data/lib/reports/ReportTableColumn.rb +82 -0
- data/lib/reports/ReportTableElement.rb +852 -0
- data/lib/reports/ReportTableLegend.rb +167 -0
- data/lib/reports/ReportTableLine.rb +87 -0
- data/lib/reports/ResourceListRE.rb +72 -0
- data/lib/reports/TaskListRE.rb +73 -0
- data/lib/reports/TjpExportRE.rb +394 -0
- data/lib/taskjuggler3.rb +106 -0
- data/lib/tj3man.rb +88 -0
- data/manual/Day_To_Day_Juggling +168 -0
- data/manual/Getting_Started +61 -0
- data/manual/How_To_Contribute +185 -0
- data/manual/Installation +68 -0
- data/manual/Intro +102 -0
- data/manual/Reporting_Bugs +26 -0
- data/manual/Rich_Text_Attributes +90 -0
- data/manual/TaskJuggler_2x_Migration +40 -0
- data/manual/Tutorial +579 -0
- data/manual/fdl +450 -0
- data/prj_cfg.rb +43 -0
- data/setup.rb +1585 -0
- data/tasks/csts.rake +72 -0
- data/tasks/gem.rake +14 -0
- data/tasks/manual.rake +10 -0
- data/tasks/missing.rake +21 -0
- data/tasks/rcov.rake +14 -0
- data/tasks/rdoc.rake +17 -0
- data/tasks/rexml_fix.rb +16 -0
- data/tasks/rexml_fix_19.rb +49 -0
- data/tasks/show.rake +21 -0
- data/tasks/stats.rake +25 -0
- data/tasks/test.rake +11 -0
- data/test/MessageChecker.rb +53 -0
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
- data/test/TestSuite/CSV-Reports/genrefs +6 -0
- data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
- data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
- data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
- data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
- data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
- data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
- data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
- data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
- data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
- data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
- data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
- data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
- data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
- data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
- data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
- data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
- data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
- data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
- data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
- data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
- data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
- data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
- data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
- data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
- data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
- data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
- data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/csvtest +16 -0
- data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
- data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
- data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
- data/test/all.rb +31 -0
- data/test/test_BatchProcessor.rb +54 -0
- data/test/test_CSV-Reports.rb +101 -0
- data/test/test_Limits.rb +104 -0
- data/test/test_LogicalExpression.rb +110 -0
- data/test/test_MacroTable.rb +51 -0
- data/test/test_Project.rb +57 -0
- data/test/test_PropertySet.rb +71 -0
- data/test/test_Query.rb +83 -0
- data/test/test_RealFormat.rb +83 -0
- data/test/test_RichText.rb +869 -0
- data/test/test_Scheduler.rb +42 -0
- data/test/test_ShiftAssignments.rb +77 -0
- data/test/test_Syntax.rb +41 -0
- data/test/test_TextScanner.rb +95 -0
- data/test/test_TjTime.rb +114 -0
- data/test/test_TjpExample.rb +169 -0
- data/test/test_UTF8String.rb +84 -0
- data/test/test_WorkingHours.rb +56 -0
- metadata +649 -0
@@ -0,0 +1,260 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: TaskJuggler::TextScanner::StreamHandle [TaskJuggler III API documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">TaskJuggler::TextScanner::StreamHandle</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../../files/lib/TextScanner_rb.html">
|
57
|
+
|
58
|
+
lib/TextScanner.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
Object
|
74
|
+
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
<!-- banner header -->
|
81
|
+
|
82
|
+
<div id="bodyContent">
|
83
|
+
|
84
|
+
<div id="contextContent">
|
85
|
+
|
86
|
+
<div id="description">
|
87
|
+
<p>
|
88
|
+
This class is used to handle the low-level input operations. It knows
|
89
|
+
whether it deals with a text buffer or a file and abstracts this to the <a
|
90
|
+
href="../TextScanner.html">TextScanner</a>. For each nested file the
|
91
|
+
scanner puts an <a href="StreamHandle.html">StreamHandle</a> on the stack
|
92
|
+
while the file is scanned. With this stack the scanner can resume the
|
93
|
+
processing of the enclosing file once the included files has been
|
94
|
+
completely processed.
|
95
|
+
</p>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<div id="method-list">
|
103
|
+
<h3 class="section-bar">Methods</h3>
|
104
|
+
|
105
|
+
<div class="name-list">
|
106
|
+
|
107
|
+
<a href="#M000408">dirname</a>
|
108
|
+
|
109
|
+
<a href="#M000407">new</a>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<!-- if includes -->
|
117
|
+
|
118
|
+
<div id="section">
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<div id="attribute-list">
|
123
|
+
<h3 class="section-bar">Attributes</h3>
|
124
|
+
|
125
|
+
<div class="name-list">
|
126
|
+
<table>
|
127
|
+
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">charBuffer</td>
|
130
|
+
|
131
|
+
<td class="context-item-value"> [RW] </td>
|
132
|
+
|
133
|
+
<td class="context-item-desc"></td>
|
134
|
+
</tr>
|
135
|
+
|
136
|
+
<tr class="top-aligned-row context-row">
|
137
|
+
<td class="context-item-name">columnNo</td>
|
138
|
+
|
139
|
+
<td class="context-item-value"> [RW] </td>
|
140
|
+
|
141
|
+
<td class="context-item-desc"></td>
|
142
|
+
</tr>
|
143
|
+
|
144
|
+
<tr class="top-aligned-row context-row">
|
145
|
+
<td class="context-item-name">fileName</td>
|
146
|
+
|
147
|
+
<td class="context-item-value"> [R] </td>
|
148
|
+
|
149
|
+
<td class="context-item-desc"></td>
|
150
|
+
</tr>
|
151
|
+
|
152
|
+
<tr class="top-aligned-row context-row">
|
153
|
+
<td class="context-item-name">line</td>
|
154
|
+
|
155
|
+
<td class="context-item-value"> [RW] </td>
|
156
|
+
|
157
|
+
<td class="context-item-desc"></td>
|
158
|
+
</tr>
|
159
|
+
|
160
|
+
<tr class="top-aligned-row context-row">
|
161
|
+
<td class="context-item-name">lineNo</td>
|
162
|
+
|
163
|
+
<td class="context-item-value"> [RW] </td>
|
164
|
+
|
165
|
+
<td class="context-item-desc"></td>
|
166
|
+
</tr>
|
167
|
+
|
168
|
+
</table>
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
<!-- if method_list -->
|
174
|
+
|
175
|
+
<div id="methods">
|
176
|
+
|
177
|
+
<h3 class="section-bar">Public Class methods</h3>
|
178
|
+
|
179
|
+
|
180
|
+
<div id="method-M000407" class="method-detail">
|
181
|
+
<a name="M000407"></a>
|
182
|
+
|
183
|
+
<div class="method-heading">
|
184
|
+
|
185
|
+
<a href="#M000407" class="method-signature">
|
186
|
+
|
187
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
188
|
+
|
189
|
+
</a>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
<p><a class="source-toggle" href="#"
|
196
|
+
onclick="toggleCode('M000407-source');return false;">[Source]</a></p>
|
197
|
+
<div class="method-source-code" id="M000407-source">
|
198
|
+
<pre>
|
199
|
+
<span class="ruby-comment cmt"># File lib/TextScanner.rb, line 38</span>
|
200
|
+
38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
201
|
+
39: <span class="ruby-ivar">@lineNo</span> = <span class="ruby-value">1</span>
|
202
|
+
40: <span class="ruby-ivar">@columnNo</span> = <span class="ruby-value">1</span>
|
203
|
+
41: <span class="ruby-ivar">@line</span> = <span class="ruby-value str">""</span>
|
204
|
+
42: <span class="ruby-ivar">@charBuffer</span> = []
|
205
|
+
43: <span class="ruby-ivar">@fileName</span> = <span class="ruby-keyword kw">nil</span>
|
206
|
+
44: <span class="ruby-keyword kw">end</span>
|
207
|
+
</pre>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
215
|
+
|
216
|
+
|
217
|
+
<div id="method-M000408" class="method-detail">
|
218
|
+
<a name="M000408"></a>
|
219
|
+
|
220
|
+
<div class="method-heading">
|
221
|
+
|
222
|
+
<a href="#M000408" class="method-signature">
|
223
|
+
|
224
|
+
<span class="method-name">dirname</span><span class="method-args">()</span>
|
225
|
+
|
226
|
+
</a>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div class="method-description">
|
231
|
+
|
232
|
+
<p><a class="source-toggle" href="#"
|
233
|
+
onclick="toggleCode('M000408-source');return false;">[Source]</a></p>
|
234
|
+
<div class="method-source-code" id="M000408-source">
|
235
|
+
<pre>
|
236
|
+
<span class="ruby-comment cmt"># File lib/TextScanner.rb, line 46</span>
|
237
|
+
46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dirname</span>
|
238
|
+
47: <span class="ruby-ivar">@fileName</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@fileName</span>) <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>
|
239
|
+
48: <span class="ruby-keyword kw">end</span>
|
240
|
+
</pre>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
<div id="validator-badges">
|
256
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
</body>
|
260
|
+
</html>
|
@@ -0,0 +1,185 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: TaskJuggler::TjException [TaskJuggler III API documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">TaskJuggler::TjException</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/TjException_rb.html">
|
57
|
+
|
58
|
+
lib/TjException.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
RuntimeError
|
74
|
+
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
<!-- banner header -->
|
81
|
+
|
82
|
+
<div id="bodyContent">
|
83
|
+
|
84
|
+
<div id="contextContent">
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
<div id="method-list">
|
90
|
+
<h3 class="section-bar">Methods</h3>
|
91
|
+
|
92
|
+
<div class="name-list">
|
93
|
+
|
94
|
+
<a href="#M000531">new</a>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<div id="attribute-list">
|
108
|
+
<h3 class="section-bar">Attributes</h3>
|
109
|
+
|
110
|
+
<div class="name-list">
|
111
|
+
<table>
|
112
|
+
|
113
|
+
<tr class="top-aligned-row context-row">
|
114
|
+
<td class="context-item-name">error</td>
|
115
|
+
|
116
|
+
<td class="context-item-value"> [R] </td>
|
117
|
+
|
118
|
+
<td class="context-item-desc"></td>
|
119
|
+
</tr>
|
120
|
+
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">fatal</td>
|
123
|
+
|
124
|
+
<td class="context-item-value"> [R] </td>
|
125
|
+
|
126
|
+
<td class="context-item-desc"></td>
|
127
|
+
</tr>
|
128
|
+
|
129
|
+
</table>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
<!-- if method_list -->
|
135
|
+
|
136
|
+
<div id="methods">
|
137
|
+
|
138
|
+
<h3 class="section-bar">Public Class methods</h3>
|
139
|
+
|
140
|
+
|
141
|
+
<div id="method-M000531" class="method-detail">
|
142
|
+
<a name="M000531"></a>
|
143
|
+
|
144
|
+
<div class="method-heading">
|
145
|
+
|
146
|
+
<a href="#M000531" class="method-signature">
|
147
|
+
|
148
|
+
<span class="method-name">new</span><span class="method-args">(error = true, fatal = false)</span>
|
149
|
+
|
150
|
+
</a>
|
151
|
+
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="method-description">
|
155
|
+
|
156
|
+
<p><a class="source-toggle" href="#"
|
157
|
+
onclick="toggleCode('M000531-source');return false;">[Source]</a></p>
|
158
|
+
<div class="method-source-code" id="M000531-source">
|
159
|
+
<pre>
|
160
|
+
<span class="ruby-comment cmt"># File lib/TjException.rb, line 19</span>
|
161
|
+
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">error</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">fatal</span> = <span class="ruby-keyword kw">false</span>)
|
162
|
+
20: <span class="ruby-ivar">@error</span> = <span class="ruby-identifier">error</span>
|
163
|
+
21: <span class="ruby-ivar">@fatal</span> = <span class="ruby-identifier">fatal</span>
|
164
|
+
22: <span class="ruby-keyword kw">end</span>
|
165
|
+
</pre>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
<div id="validator-badges">
|
181
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
</body>
|
185
|
+
</html>
|
@@ -0,0 +1,1845 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: TaskJuggler::TjTime [TaskJuggler III API documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">TaskJuggler::TjTime</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/TjTime_rb.html">
|
57
|
+
|
58
|
+
lib/TjTime.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
Object
|
74
|
+
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
<!-- banner header -->
|
81
|
+
|
82
|
+
<div id="bodyContent">
|
83
|
+
|
84
|
+
<div id="contextContent">
|
85
|
+
|
86
|
+
<div id="description">
|
87
|
+
<p>
|
88
|
+
The <a href="TjTime.html">TjTime</a> class is based on the original Ruby
|
89
|
+
class Time but provides lots of additional functionality.
|
90
|
+
</p>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<div id="method-list">
|
98
|
+
<h3 class="section-bar">Methods</h3>
|
99
|
+
|
100
|
+
<div class="name-list">
|
101
|
+
|
102
|
+
<a href="#M000868">%</a>
|
103
|
+
|
104
|
+
<a href="#M000866">+</a>
|
105
|
+
|
106
|
+
<a href="#M000867">-</a>
|
107
|
+
|
108
|
+
<a href="#M000869"><</a>
|
109
|
+
|
110
|
+
<a href="#M000870"><=</a>
|
111
|
+
|
112
|
+
<a href="#M000874"><=></a>
|
113
|
+
|
114
|
+
<a href="#M000873">==</a>
|
115
|
+
|
116
|
+
<a href="#M000871">></a>
|
117
|
+
|
118
|
+
<a href="#M000872">>=</a>
|
119
|
+
|
120
|
+
<a href="#M000864">align</a>
|
121
|
+
|
122
|
+
<a href="#M000876">beginOfHour</a>
|
123
|
+
|
124
|
+
<a href="#M000879">beginOfMonth</a>
|
125
|
+
|
126
|
+
<a href="#M000880">beginOfQuarter</a>
|
127
|
+
|
128
|
+
<a href="#M000878">beginOfWeek</a>
|
129
|
+
|
130
|
+
<a href="#M000881">beginOfYear</a>
|
131
|
+
|
132
|
+
<a href="#M000890">daysTo</a>
|
133
|
+
|
134
|
+
<a href="#M000862">gm</a>
|
135
|
+
|
136
|
+
<a href="#M000882">hoursLater</a>
|
137
|
+
|
138
|
+
<a href="#M000889">hoursTo</a>
|
139
|
+
|
140
|
+
<a href="#M000863">local</a>
|
141
|
+
|
142
|
+
<a href="#M000902">method_missing</a>
|
143
|
+
|
144
|
+
<a href="#M000877">midnight</a>
|
145
|
+
|
146
|
+
<a href="#M000900">monthAndYear</a>
|
147
|
+
|
148
|
+
<a href="#M000892">monthsTo</a>
|
149
|
+
|
150
|
+
<a href="#M000860">new</a>
|
151
|
+
|
152
|
+
<a href="#M000861">now</a>
|
153
|
+
|
154
|
+
<a href="#M000898">quarterName</a>
|
155
|
+
|
156
|
+
<a href="#M000893">quartersTo</a>
|
157
|
+
|
158
|
+
<a href="#M000884">sameTimeNextDay</a>
|
159
|
+
|
160
|
+
<a href="#M000883">sameTimeNextHour</a>
|
161
|
+
|
162
|
+
<a href="#M000886">sameTimeNextMonth</a>
|
163
|
+
|
164
|
+
<a href="#M000887">sameTimeNextQuarter</a>
|
165
|
+
|
166
|
+
<a href="#M000885">sameTimeNextWeek</a>
|
167
|
+
|
168
|
+
<a href="#M000888">sameTimeNextYear</a>
|
169
|
+
|
170
|
+
<a href="#M000865">secondsOfDay</a>
|
171
|
+
|
172
|
+
<a href="#M000897">shortMonthName</a>
|
173
|
+
|
174
|
+
<a href="#M000896">to_i</a>
|
175
|
+
|
176
|
+
<a href="#M000895">to_s</a>
|
177
|
+
|
178
|
+
<a href="#M000875">upto</a>
|
179
|
+
|
180
|
+
<a href="#M000899">week</a>
|
181
|
+
|
182
|
+
<a href="#M000901">weekdayAndDate</a>
|
183
|
+
|
184
|
+
<a href="#M000891">weeksTo</a>
|
185
|
+
|
186
|
+
<a href="#M000894">yearsTo</a>
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<!-- if includes -->
|
194
|
+
|
195
|
+
<div id="section">
|
196
|
+
|
197
|
+
<div id="constants-list">
|
198
|
+
<h3 class="section-bar">Constants</h3>
|
199
|
+
|
200
|
+
<div class="name-list">
|
201
|
+
<table summary="Constants">
|
202
|
+
|
203
|
+
<tr class="top-aligned-row context-row">
|
204
|
+
<td class="context-item-name">MON_MAX</td>
|
205
|
+
<td>=</td>
|
206
|
+
<td class="context-item-value">[ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]</td>
|
207
|
+
|
208
|
+
<td> </td>
|
209
|
+
<td class="context-item-desc">
|
210
|
+
The number of days per month. Leap years are taken care of separately.
|
211
|
+
|
212
|
+
</td>
|
213
|
+
|
214
|
+
</tr>
|
215
|
+
|
216
|
+
</table>
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
<div id="attribute-list">
|
223
|
+
<h3 class="section-bar">Attributes</h3>
|
224
|
+
|
225
|
+
<div class="name-list">
|
226
|
+
<table>
|
227
|
+
|
228
|
+
<tr class="top-aligned-row context-row">
|
229
|
+
<td class="context-item-name">time</td>
|
230
|
+
|
231
|
+
<td class="context-item-value"> [R] </td>
|
232
|
+
|
233
|
+
<td class="context-item-desc"></td>
|
234
|
+
</tr>
|
235
|
+
|
236
|
+
</table>
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
|
241
|
+
<!-- if method_list -->
|
242
|
+
|
243
|
+
<div id="methods">
|
244
|
+
|
245
|
+
<h3 class="section-bar">Public Class methods</h3>
|
246
|
+
|
247
|
+
|
248
|
+
<div id="method-M000862" class="method-detail">
|
249
|
+
<a name="M000862"></a>
|
250
|
+
|
251
|
+
<div class="method-heading">
|
252
|
+
|
253
|
+
<a href="#M000862" class="method-signature">
|
254
|
+
|
255
|
+
<span class="method-name">gm</span><span class="method-args">(*args)</span>
|
256
|
+
|
257
|
+
</a>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
<div class="method-description">
|
262
|
+
|
263
|
+
<p>
|
264
|
+
Creates a time based on given values, interpreted as UTC. See Time.gm() for
|
265
|
+
details.
|
266
|
+
</p>
|
267
|
+
|
268
|
+
<p><a class="source-toggle" href="#"
|
269
|
+
onclick="toggleCode('M000862-source');return false;">[Source]</a></p>
|
270
|
+
<div class="method-source-code" id="M000862-source">
|
271
|
+
<pre>
|
272
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 53</span>
|
273
|
+
53: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">gm</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
274
|
+
54: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">gm</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>))
|
275
|
+
55: <span class="ruby-keyword kw">end</span>
|
276
|
+
</pre>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
|
283
|
+
<div id="method-M000863" class="method-detail">
|
284
|
+
<a name="M000863"></a>
|
285
|
+
|
286
|
+
<div class="method-heading">
|
287
|
+
|
288
|
+
<a href="#M000863" class="method-signature">
|
289
|
+
|
290
|
+
<span class="method-name">local</span><span class="method-args">(*args)</span>
|
291
|
+
|
292
|
+
</a>
|
293
|
+
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div class="method-description">
|
297
|
+
|
298
|
+
<p>
|
299
|
+
Creates a time based on given values, interpreted as local time. The result
|
300
|
+
is stored as UTC time, though. See Time.local() for details.
|
301
|
+
</p>
|
302
|
+
|
303
|
+
<p><a class="source-toggle" href="#"
|
304
|
+
onclick="toggleCode('M000863-source');return false;">[Source]</a></p>
|
305
|
+
<div class="method-source-code" id="M000863-source">
|
306
|
+
<pre>
|
307
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 59</span>
|
308
|
+
59: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
309
|
+
60: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>).<span class="ruby-identifier">gmtime</span>)
|
310
|
+
61: <span class="ruby-keyword kw">end</span>
|
311
|
+
</pre>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</div>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
|
318
|
+
<div id="method-M000860" class="method-detail">
|
319
|
+
<a name="M000860"></a>
|
320
|
+
|
321
|
+
<div class="method-heading">
|
322
|
+
|
323
|
+
<a href="#M000860" class="method-signature">
|
324
|
+
|
325
|
+
<span class="method-name">TjTime(time) → Scenario<br />
|
326
|
+
TjTime(s) → Scenario<br />
|
327
|
+
TjTime(secs) → Scenario<br />
|
328
|
+
</span>
|
329
|
+
|
330
|
+
</a>
|
331
|
+
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div class="method-description">
|
335
|
+
|
336
|
+
<p>
|
337
|
+
The constructor is overloaded and accepts 3 kinds of arguments. If
|
338
|
+
<em>t</em> is a Time object this is just copied to the @time variable. If
|
339
|
+
it’s a string, it is parsed as a date. Or else it is interpreted as
|
340
|
+
seconds after Epoch.
|
341
|
+
</p>
|
342
|
+
|
343
|
+
<p><a class="source-toggle" href="#"
|
344
|
+
onclick="toggleCode('M000860-source');return false;">[Source]</a></p>
|
345
|
+
<div class="method-source-code" id="M000860-source">
|
346
|
+
<pre>
|
347
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 35</span>
|
348
|
+
35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">t</span>)
|
349
|
+
36: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Time</span>)
|
350
|
+
37: <span class="ruby-ivar">@time</span> = <span class="ruby-identifier">t</span>
|
351
|
+
38: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
352
|
+
39: <span class="ruby-identifier">d</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">t</span>)
|
353
|
+
40: <span class="ruby-ivar">@time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>(<span class="ruby-identifier">d</span>.<span class="ruby-identifier">year</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">mon</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">day</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">hour</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">min</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">sec</span>)
|
354
|
+
41: <span class="ruby-keyword kw">else</span>
|
355
|
+
42: <span class="ruby-ivar">@time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">t</span>)
|
356
|
+
43: <span class="ruby-keyword kw">end</span>
|
357
|
+
44: <span class="ruby-keyword kw">end</span>
|
358
|
+
</pre>
|
359
|
+
</div>
|
360
|
+
|
361
|
+
</div>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
|
365
|
+
<div id="method-M000861" class="method-detail">
|
366
|
+
<a name="M000861"></a>
|
367
|
+
|
368
|
+
<div class="method-heading">
|
369
|
+
|
370
|
+
<a href="#M000861" class="method-signature">
|
371
|
+
|
372
|
+
<span class="method-name">now</span><span class="method-args">()</span>
|
373
|
+
|
374
|
+
</a>
|
375
|
+
|
376
|
+
</div>
|
377
|
+
|
378
|
+
<div class="method-description">
|
379
|
+
|
380
|
+
<p>
|
381
|
+
Returns the current UTC time as Time object.
|
382
|
+
</p>
|
383
|
+
|
384
|
+
<p><a class="source-toggle" href="#"
|
385
|
+
onclick="toggleCode('M000861-source');return false;">[Source]</a></p>
|
386
|
+
<div class="method-source-code" id="M000861-source">
|
387
|
+
<pre>
|
388
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 47</span>
|
389
|
+
47: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">now</span>
|
390
|
+
48: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">gmtime</span>)
|
391
|
+
49: <span class="ruby-keyword kw">end</span>
|
392
|
+
</pre>
|
393
|
+
</div>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
|
399
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
400
|
+
|
401
|
+
|
402
|
+
<div id="method-M000868" class="method-detail">
|
403
|
+
<a name="M000868"></a>
|
404
|
+
|
405
|
+
<div class="method-heading">
|
406
|
+
|
407
|
+
<a href="#M000868" class="method-signature">
|
408
|
+
|
409
|
+
<span class="method-name">%</span><span class="method-args">(val)</span>
|
410
|
+
|
411
|
+
</a>
|
412
|
+
|
413
|
+
</div>
|
414
|
+
|
415
|
+
<div class="method-description">
|
416
|
+
|
417
|
+
<p>
|
418
|
+
Convert the time to seconds since Epoch and return the module of
|
419
|
+
<em>val</em>.
|
420
|
+
</p>
|
421
|
+
|
422
|
+
<p><a class="source-toggle" href="#"
|
423
|
+
onclick="toggleCode('M000868-source');return false;">[Source]</a></p>
|
424
|
+
<div class="method-source-code" id="M000868-source">
|
425
|
+
<pre>
|
426
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 91</span>
|
427
|
+
91: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">%</span>(<span class="ruby-identifier">val</span>)
|
428
|
+
92: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">val</span>
|
429
|
+
93: <span class="ruby-keyword kw">end</span>
|
430
|
+
</pre>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
</div>
|
434
|
+
</div>
|
435
|
+
|
436
|
+
|
437
|
+
<div id="method-M000866" class="method-detail">
|
438
|
+
<a name="M000866"></a>
|
439
|
+
|
440
|
+
<div class="method-heading">
|
441
|
+
|
442
|
+
<a href="#M000866" class="method-signature">
|
443
|
+
|
444
|
+
<span class="method-name">+</span><span class="method-args">(secs)</span>
|
445
|
+
|
446
|
+
</a>
|
447
|
+
|
448
|
+
</div>
|
449
|
+
|
450
|
+
<div class="method-description">
|
451
|
+
|
452
|
+
<p>
|
453
|
+
Add <em>secs</em> number of seconds to the time.
|
454
|
+
</p>
|
455
|
+
|
456
|
+
<p><a class="source-toggle" href="#"
|
457
|
+
onclick="toggleCode('M000866-source');return false;">[Source]</a></p>
|
458
|
+
<div class="method-source-code" id="M000866-source">
|
459
|
+
<pre>
|
460
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 76</span>
|
461
|
+
76: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">secs</span>)
|
462
|
+
77: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">secs</span>)
|
463
|
+
78: <span class="ruby-keyword kw">end</span>
|
464
|
+
</pre>
|
465
|
+
</div>
|
466
|
+
|
467
|
+
</div>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
|
471
|
+
<div id="method-M000867" class="method-detail">
|
472
|
+
<a name="M000867"></a>
|
473
|
+
|
474
|
+
<div class="method-heading">
|
475
|
+
|
476
|
+
<a href="#M000867" class="method-signature">
|
477
|
+
|
478
|
+
<span class="method-name">-</span><span class="method-args">(arg)</span>
|
479
|
+
|
480
|
+
</a>
|
481
|
+
|
482
|
+
</div>
|
483
|
+
|
484
|
+
<div class="method-description">
|
485
|
+
|
486
|
+
<p>
|
487
|
+
Substract <em>arg</em> number of seconds or return the number of seconds
|
488
|
+
between <em>arg</em> and this time.
|
489
|
+
</p>
|
490
|
+
|
491
|
+
<p><a class="source-toggle" href="#"
|
492
|
+
onclick="toggleCode('M000867-source');return false;">[Source]</a></p>
|
493
|
+
<div class="method-source-code" id="M000867-source">
|
494
|
+
<pre>
|
495
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 82</span>
|
496
|
+
82: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">arg</span>)
|
497
|
+
83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">TjTime</span>)
|
498
|
+
84: <span class="ruby-ivar">@time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">time</span>
|
499
|
+
85: <span class="ruby-keyword kw">else</span>
|
500
|
+
86: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">arg</span>)
|
501
|
+
87: <span class="ruby-keyword kw">end</span>
|
502
|
+
88: <span class="ruby-keyword kw">end</span>
|
503
|
+
</pre>
|
504
|
+
</div>
|
505
|
+
|
506
|
+
</div>
|
507
|
+
</div>
|
508
|
+
|
509
|
+
|
510
|
+
<div id="method-M000869" class="method-detail">
|
511
|
+
<a name="M000869"></a>
|
512
|
+
|
513
|
+
<div class="method-heading">
|
514
|
+
|
515
|
+
<a href="#M000869" class="method-signature">
|
516
|
+
|
517
|
+
<span class="method-name"><</span><span class="method-args">(t)</span>
|
518
|
+
|
519
|
+
</a>
|
520
|
+
|
521
|
+
</div>
|
522
|
+
|
523
|
+
<div class="method-description">
|
524
|
+
|
525
|
+
<p>
|
526
|
+
Return true if time is smaller than <em>t</em>.
|
527
|
+
</p>
|
528
|
+
|
529
|
+
<p><a class="source-toggle" href="#"
|
530
|
+
onclick="toggleCode('M000869-source');return false;">[Source]</a></p>
|
531
|
+
<div class="method-source-code" id="M000869-source">
|
532
|
+
<pre>
|
533
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 96</span>
|
534
|
+
96: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><</span>(<span class="ruby-identifier">t</span>)
|
535
|
+
97: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
536
|
+
98: <span class="ruby-keyword kw">end</span>
|
537
|
+
</pre>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
</div>
|
541
|
+
</div>
|
542
|
+
|
543
|
+
|
544
|
+
<div id="method-M000870" class="method-detail">
|
545
|
+
<a name="M000870"></a>
|
546
|
+
|
547
|
+
<div class="method-heading">
|
548
|
+
|
549
|
+
<a href="#M000870" class="method-signature">
|
550
|
+
|
551
|
+
<span class="method-name"><=</span><span class="method-args">(t)</span>
|
552
|
+
|
553
|
+
</a>
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
<div class="method-description">
|
558
|
+
|
559
|
+
<p>
|
560
|
+
Return true if time is smaller or equal than <em>t</em>.
|
561
|
+
</p>
|
562
|
+
|
563
|
+
<p><a class="source-toggle" href="#"
|
564
|
+
onclick="toggleCode('M000870-source');return false;">[Source]</a></p>
|
565
|
+
<div class="method-source-code" id="M000870-source">
|
566
|
+
<pre>
|
567
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 101</span>
|
568
|
+
101: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=</span>(<span class="ruby-identifier">t</span>)
|
569
|
+
102: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
570
|
+
103: <span class="ruby-keyword kw">end</span>
|
571
|
+
</pre>
|
572
|
+
</div>
|
573
|
+
|
574
|
+
</div>
|
575
|
+
</div>
|
576
|
+
|
577
|
+
|
578
|
+
<div id="method-M000874" class="method-detail">
|
579
|
+
<a name="M000874"></a>
|
580
|
+
|
581
|
+
<div class="method-heading">
|
582
|
+
|
583
|
+
<a href="#M000874" class="method-signature">
|
584
|
+
|
585
|
+
<span class="method-name"><=></span><span class="method-args">(t)</span>
|
586
|
+
|
587
|
+
</a>
|
588
|
+
|
589
|
+
</div>
|
590
|
+
|
591
|
+
<div class="method-description">
|
592
|
+
|
593
|
+
<p>
|
594
|
+
Coparison operator for time with another time <em>t</em>.
|
595
|
+
</p>
|
596
|
+
|
597
|
+
<p><a class="source-toggle" href="#"
|
598
|
+
onclick="toggleCode('M000874-source');return false;">[Source]</a></p>
|
599
|
+
<div class="method-source-code" id="M000874-source">
|
600
|
+
<pre>
|
601
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 122</span>
|
602
|
+
122: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=></span>(<span class="ruby-identifier">t</span>)
|
603
|
+
123: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
604
|
+
124: <span class="ruby-keyword kw">end</span>
|
605
|
+
</pre>
|
606
|
+
</div>
|
607
|
+
|
608
|
+
</div>
|
609
|
+
</div>
|
610
|
+
|
611
|
+
|
612
|
+
<div id="method-M000873" class="method-detail">
|
613
|
+
<a name="M000873"></a>
|
614
|
+
|
615
|
+
<div class="method-heading">
|
616
|
+
|
617
|
+
<a href="#M000873" class="method-signature">
|
618
|
+
|
619
|
+
<span class="method-name">==</span><span class="method-args">(t)</span>
|
620
|
+
|
621
|
+
</a>
|
622
|
+
|
623
|
+
</div>
|
624
|
+
|
625
|
+
<div class="method-description">
|
626
|
+
|
627
|
+
<p>
|
628
|
+
Return true if time and <em>t</em> are identical.
|
629
|
+
</p>
|
630
|
+
|
631
|
+
<p><a class="source-toggle" href="#"
|
632
|
+
onclick="toggleCode('M000873-source');return false;">[Source]</a></p>
|
633
|
+
<div class="method-source-code" id="M000873-source">
|
634
|
+
<pre>
|
635
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 116</span>
|
636
|
+
116: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">t</span>)
|
637
|
+
117: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">nil?</span>
|
638
|
+
118: <span class="ruby-ivar">@time</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
639
|
+
119: <span class="ruby-keyword kw">end</span>
|
640
|
+
</pre>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
</div>
|
644
|
+
</div>
|
645
|
+
|
646
|
+
|
647
|
+
<div id="method-M000871" class="method-detail">
|
648
|
+
<a name="M000871"></a>
|
649
|
+
|
650
|
+
<div class="method-heading">
|
651
|
+
|
652
|
+
<a href="#M000871" class="method-signature">
|
653
|
+
|
654
|
+
<span class="method-name">></span><span class="method-args">(t)</span>
|
655
|
+
|
656
|
+
</a>
|
657
|
+
|
658
|
+
</div>
|
659
|
+
|
660
|
+
<div class="method-description">
|
661
|
+
|
662
|
+
<p>
|
663
|
+
Return true if time is larger than <em>t</em>.
|
664
|
+
</p>
|
665
|
+
|
666
|
+
<p><a class="source-toggle" href="#"
|
667
|
+
onclick="toggleCode('M000871-source');return false;">[Source]</a></p>
|
668
|
+
<div class="method-source-code" id="M000871-source">
|
669
|
+
<pre>
|
670
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 106</span>
|
671
|
+
106: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">></span>(<span class="ruby-identifier">t</span>)
|
672
|
+
107: <span class="ruby-ivar">@time</span> <span class="ruby-operator">></span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
673
|
+
108: <span class="ruby-keyword kw">end</span>
|
674
|
+
</pre>
|
675
|
+
</div>
|
676
|
+
|
677
|
+
</div>
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
<div id="method-M000872" class="method-detail">
|
682
|
+
<a name="M000872"></a>
|
683
|
+
|
684
|
+
<div class="method-heading">
|
685
|
+
|
686
|
+
<a href="#M000872" class="method-signature">
|
687
|
+
|
688
|
+
<span class="method-name">>=</span><span class="method-args">(t)</span>
|
689
|
+
|
690
|
+
</a>
|
691
|
+
|
692
|
+
</div>
|
693
|
+
|
694
|
+
<div class="method-description">
|
695
|
+
|
696
|
+
<p>
|
697
|
+
Return true if time is larger or equal than <em>t</em>.
|
698
|
+
</p>
|
699
|
+
|
700
|
+
<p><a class="source-toggle" href="#"
|
701
|
+
onclick="toggleCode('M000872-source');return false;">[Source]</a></p>
|
702
|
+
<div class="method-source-code" id="M000872-source">
|
703
|
+
<pre>
|
704
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 111</span>
|
705
|
+
111: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">>=</span>(<span class="ruby-identifier">t</span>)
|
706
|
+
112: <span class="ruby-ivar">@time</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
707
|
+
113: <span class="ruby-keyword kw">end</span>
|
708
|
+
</pre>
|
709
|
+
</div>
|
710
|
+
|
711
|
+
</div>
|
712
|
+
</div>
|
713
|
+
|
714
|
+
|
715
|
+
<div id="method-M000864" class="method-detail">
|
716
|
+
<a name="M000864"></a>
|
717
|
+
|
718
|
+
<div class="method-heading">
|
719
|
+
|
720
|
+
<a href="#M000864" class="method-signature">
|
721
|
+
|
722
|
+
<span class="method-name">align</span><span class="method-args">(clock)</span>
|
723
|
+
|
724
|
+
</a>
|
725
|
+
|
726
|
+
</div>
|
727
|
+
|
728
|
+
<div class="method-description">
|
729
|
+
|
730
|
+
<p>
|
731
|
+
Align the date to a time grid. The grid distance is determined by
|
732
|
+
<em>clock</em>.
|
733
|
+
</p>
|
734
|
+
|
735
|
+
<p><a class="source-toggle" href="#"
|
736
|
+
onclick="toggleCode('M000864-source');return false;">[Source]</a></p>
|
737
|
+
<div class="method-source-code" id="M000864-source">
|
738
|
+
<pre>
|
739
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 64</span>
|
740
|
+
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align</span>(<span class="ruby-identifier">clock</span>)
|
741
|
+
65: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>((<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">clock</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">clock</span>)
|
742
|
+
66: <span class="ruby-keyword kw">end</span>
|
743
|
+
</pre>
|
744
|
+
</div>
|
745
|
+
|
746
|
+
</div>
|
747
|
+
</div>
|
748
|
+
|
749
|
+
|
750
|
+
<div id="method-M000876" class="method-detail">
|
751
|
+
<a name="M000876"></a>
|
752
|
+
|
753
|
+
<div class="method-heading">
|
754
|
+
|
755
|
+
<a href="#M000876" class="method-signature">
|
756
|
+
|
757
|
+
<span class="method-name">beginOfHour</span><span class="method-args">()</span>
|
758
|
+
|
759
|
+
</a>
|
760
|
+
|
761
|
+
</div>
|
762
|
+
|
763
|
+
<div class="method-description">
|
764
|
+
|
765
|
+
<p>
|
766
|
+
Normalize time to the beginning of the current hour.
|
767
|
+
</p>
|
768
|
+
|
769
|
+
<p><a class="source-toggle" href="#"
|
770
|
+
onclick="toggleCode('M000876-source');return false;">[Source]</a></p>
|
771
|
+
<div class="method-source-code" id="M000876-source">
|
772
|
+
<pre>
|
773
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 137</span>
|
774
|
+
137: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfHour</span>
|
775
|
+
138: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
776
|
+
139: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">2</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2</span>, <span class="ruby-value">0</span>)
|
777
|
+
140: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
778
|
+
141: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
779
|
+
142: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
780
|
+
143: <span class="ruby-keyword kw">end</span>
|
781
|
+
</pre>
|
782
|
+
</div>
|
783
|
+
|
784
|
+
</div>
|
785
|
+
</div>
|
786
|
+
|
787
|
+
|
788
|
+
<div id="method-M000879" class="method-detail">
|
789
|
+
<a name="M000879"></a>
|
790
|
+
|
791
|
+
<div class="method-heading">
|
792
|
+
|
793
|
+
<a href="#M000879" class="method-signature">
|
794
|
+
|
795
|
+
<span class="method-name">beginOfMonth</span><span class="method-args">()</span>
|
796
|
+
|
797
|
+
</a>
|
798
|
+
|
799
|
+
</div>
|
800
|
+
|
801
|
+
<div class="method-description">
|
802
|
+
|
803
|
+
<p>
|
804
|
+
Normalize time to the beginning of the current month.
|
805
|
+
</p>
|
806
|
+
|
807
|
+
<p><a class="source-toggle" href="#"
|
808
|
+
onclick="toggleCode('M000879-source');return false;">[Source]</a></p>
|
809
|
+
<div class="method-source-code" id="M000879-source">
|
810
|
+
<pre>
|
811
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 170</span>
|
812
|
+
170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfMonth</span>
|
813
|
+
171: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
814
|
+
172: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
815
|
+
173: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>] = <span class="ruby-value">1</span>
|
816
|
+
174: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
817
|
+
175: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
818
|
+
176: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
819
|
+
177: <span class="ruby-keyword kw">end</span>
|
820
|
+
</pre>
|
821
|
+
</div>
|
822
|
+
|
823
|
+
</div>
|
824
|
+
</div>
|
825
|
+
|
826
|
+
|
827
|
+
<div id="method-M000880" class="method-detail">
|
828
|
+
<a name="M000880"></a>
|
829
|
+
|
830
|
+
<div class="method-heading">
|
831
|
+
|
832
|
+
<a href="#M000880" class="method-signature">
|
833
|
+
|
834
|
+
<span class="method-name">beginOfQuarter</span><span class="method-args">()</span>
|
835
|
+
|
836
|
+
</a>
|
837
|
+
|
838
|
+
</div>
|
839
|
+
|
840
|
+
<div class="method-description">
|
841
|
+
|
842
|
+
<p>
|
843
|
+
Normalize time to the beginning of the current quarter.
|
844
|
+
</p>
|
845
|
+
|
846
|
+
<p><a class="source-toggle" href="#"
|
847
|
+
onclick="toggleCode('M000880-source');return false;">[Source]</a></p>
|
848
|
+
<div class="method-source-code" id="M000880-source">
|
849
|
+
<pre>
|
850
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 180</span>
|
851
|
+
180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfQuarter</span>
|
852
|
+
181: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
853
|
+
182: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
854
|
+
183: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>] = <span class="ruby-value">1</span>
|
855
|
+
184: <span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] = ((<span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">%</span> <span class="ruby-value">3</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
856
|
+
185: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
857
|
+
186: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
858
|
+
187: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
859
|
+
188: <span class="ruby-keyword kw">end</span>
|
860
|
+
</pre>
|
861
|
+
</div>
|
862
|
+
|
863
|
+
</div>
|
864
|
+
</div>
|
865
|
+
|
866
|
+
|
867
|
+
<div id="method-M000878" class="method-detail">
|
868
|
+
<a name="M000878"></a>
|
869
|
+
|
870
|
+
<div class="method-heading">
|
871
|
+
|
872
|
+
<a href="#M000878" class="method-signature">
|
873
|
+
|
874
|
+
<span class="method-name">beginOfWeek</span><span class="method-args">(startMonday)</span>
|
875
|
+
|
876
|
+
</a>
|
877
|
+
|
878
|
+
</div>
|
879
|
+
|
880
|
+
<div class="method-description">
|
881
|
+
|
882
|
+
<p>
|
883
|
+
Normalize time to the beginning of the current week. <em>startMonday</em>
|
884
|
+
determines whether the week should start on Monday or Sunday.
|
885
|
+
</p>
|
886
|
+
|
887
|
+
<p><a class="source-toggle" href="#"
|
888
|
+
onclick="toggleCode('M000878-source');return false;">[Source]</a></p>
|
889
|
+
<div class="method-source-code" id="M000878-source">
|
890
|
+
<pre>
|
891
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 156</span>
|
892
|
+
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfWeek</span>(<span class="ruby-identifier">startMonday</span>)
|
893
|
+
157: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_a</span>
|
894
|
+
158: <span class="ruby-comment cmt"># Set time to noon, 12:00:00</span>
|
895
|
+
159: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = [ <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-value">12</span> ]
|
896
|
+
160: <span class="ruby-identifier">weekday</span> = <span class="ruby-identifier">t</span>[<span class="ruby-value">6</span>]
|
897
|
+
161: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
898
|
+
162: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
899
|
+
163: <span class="ruby-comment cmt"># Substract the number of days determined by the weekday t[6] and set time</span>
|
900
|
+
164: <span class="ruby-comment cmt"># to midnight of that day.</span>
|
901
|
+
165: (<span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>)) <span class="ruby-operator">-</span>
|
902
|
+
166: (<span class="ruby-identifier">weekday</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">startMonday</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)) <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">24</span>).<span class="ruby-identifier">midnight</span>
|
903
|
+
167: <span class="ruby-keyword kw">end</span>
|
904
|
+
</pre>
|
905
|
+
</div>
|
906
|
+
|
907
|
+
</div>
|
908
|
+
</div>
|
909
|
+
|
910
|
+
|
911
|
+
<div id="method-M000881" class="method-detail">
|
912
|
+
<a name="M000881"></a>
|
913
|
+
|
914
|
+
<div class="method-heading">
|
915
|
+
|
916
|
+
<a href="#M000881" class="method-signature">
|
917
|
+
|
918
|
+
<span class="method-name">beginOfYear</span><span class="method-args">()</span>
|
919
|
+
|
920
|
+
</a>
|
921
|
+
|
922
|
+
</div>
|
923
|
+
|
924
|
+
<div class="method-description">
|
925
|
+
|
926
|
+
<p>
|
927
|
+
Normalize time to the beginning of the current year.
|
928
|
+
</p>
|
929
|
+
|
930
|
+
<p><a class="source-toggle" href="#"
|
931
|
+
onclick="toggleCode('M000881-source');return false;">[Source]</a></p>
|
932
|
+
<div class="method-source-code" id="M000881-source">
|
933
|
+
<pre>
|
934
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 191</span>
|
935
|
+
191: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfYear</span>
|
936
|
+
192: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
937
|
+
193: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
938
|
+
194: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>, <span class="ruby-value">2</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2</span>, <span class="ruby-value">1</span>)
|
939
|
+
195: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
940
|
+
196: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
941
|
+
197: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
942
|
+
198: <span class="ruby-keyword kw">end</span>
|
943
|
+
</pre>
|
944
|
+
</div>
|
945
|
+
|
946
|
+
</div>
|
947
|
+
</div>
|
948
|
+
|
949
|
+
|
950
|
+
<div id="method-M000890" class="method-detail">
|
951
|
+
<a name="M000890"></a>
|
952
|
+
|
953
|
+
<div class="method-heading">
|
954
|
+
|
955
|
+
<a href="#M000890" class="method-signature">
|
956
|
+
|
957
|
+
<span class="method-name">daysTo</span><span class="method-args">(date)</span>
|
958
|
+
|
959
|
+
</a>
|
960
|
+
|
961
|
+
</div>
|
962
|
+
|
963
|
+
<div class="method-description">
|
964
|
+
|
965
|
+
<p>
|
966
|
+
Return the number of days between this time and <em>date</em>. The result
|
967
|
+
is always rounded up.
|
968
|
+
</p>
|
969
|
+
|
970
|
+
<p><a class="source-toggle" href="#"
|
971
|
+
onclick="toggleCode('M000890-source');return false;">[Source]</a></p>
|
972
|
+
<div class="method-source-code" id="M000890-source">
|
973
|
+
<pre>
|
974
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 283</span>
|
975
|
+
283: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">daysTo</span>(<span class="ruby-identifier">date</span>)
|
976
|
+
284: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">:sameTimeNextDay</span>)
|
977
|
+
285: <span class="ruby-keyword kw">end</span>
|
978
|
+
</pre>
|
979
|
+
</div>
|
980
|
+
|
981
|
+
</div>
|
982
|
+
</div>
|
983
|
+
|
984
|
+
|
985
|
+
<div id="method-M000882" class="method-detail">
|
986
|
+
<a name="M000882"></a>
|
987
|
+
|
988
|
+
<div class="method-heading">
|
989
|
+
|
990
|
+
<a href="#M000882" class="method-signature">
|
991
|
+
|
992
|
+
<span class="method-name">hoursLater</span><span class="method-args">(hours)</span>
|
993
|
+
|
994
|
+
</a>
|
995
|
+
|
996
|
+
</div>
|
997
|
+
|
998
|
+
<div class="method-description">
|
999
|
+
|
1000
|
+
<p>
|
1001
|
+
Return a new time that is <em>hours</em> later than time.
|
1002
|
+
</p>
|
1003
|
+
|
1004
|
+
<p><a class="source-toggle" href="#"
|
1005
|
+
onclick="toggleCode('M000882-source');return false;">[Source]</a></p>
|
1006
|
+
<div class="method-source-code" id="M000882-source">
|
1007
|
+
<pre>
|
1008
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 201</span>
|
1009
|
+
201: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hoursLater</span>(<span class="ruby-identifier">hours</span>)
|
1010
|
+
202: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">hours</span> <span class="ruby-operator">*</span> <span class="ruby-value">3600</span>)
|
1011
|
+
203: <span class="ruby-keyword kw">end</span>
|
1012
|
+
</pre>
|
1013
|
+
</div>
|
1014
|
+
|
1015
|
+
</div>
|
1016
|
+
</div>
|
1017
|
+
|
1018
|
+
|
1019
|
+
<div id="method-M000889" class="method-detail">
|
1020
|
+
<a name="M000889"></a>
|
1021
|
+
|
1022
|
+
<div class="method-heading">
|
1023
|
+
|
1024
|
+
<a href="#M000889" class="method-signature">
|
1025
|
+
|
1026
|
+
<span class="method-name">hoursTo</span><span class="method-args">(date)</span>
|
1027
|
+
|
1028
|
+
</a>
|
1029
|
+
|
1030
|
+
</div>
|
1031
|
+
|
1032
|
+
<div class="method-description">
|
1033
|
+
|
1034
|
+
<p>
|
1035
|
+
Return the number of hours between this time and <em>date</em>. The result
|
1036
|
+
is always rounded up.
|
1037
|
+
</p>
|
1038
|
+
|
1039
|
+
<p><a class="source-toggle" href="#"
|
1040
|
+
onclick="toggleCode('M000889-source');return false;">[Source]</a></p>
|
1041
|
+
<div class="method-source-code" id="M000889-source">
|
1042
|
+
<pre>
|
1043
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 276</span>
|
1044
|
+
276: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hoursTo</span>(<span class="ruby-identifier">date</span>)
|
1045
|
+
277: <span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span> = <span class="ruby-identifier">order</span>(<span class="ruby-identifier">date</span>)
|
1046
|
+
278: ((<span class="ruby-identifier">t2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">t1</span>) <span class="ruby-operator">/</span> <span class="ruby-value">3600</span>).<span class="ruby-identifier">ceil</span>
|
1047
|
+
279: <span class="ruby-keyword kw">end</span>
|
1048
|
+
</pre>
|
1049
|
+
</div>
|
1050
|
+
|
1051
|
+
</div>
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
|
1055
|
+
<div id="method-M000902" class="method-detail">
|
1056
|
+
<a name="M000902"></a>
|
1057
|
+
|
1058
|
+
<div class="method-heading">
|
1059
|
+
|
1060
|
+
<a href="#M000902" class="method-signature">
|
1061
|
+
|
1062
|
+
<span class="method-name">method_missing</span><span class="method-args">(func, *args)</span>
|
1063
|
+
|
1064
|
+
</a>
|
1065
|
+
|
1066
|
+
</div>
|
1067
|
+
|
1068
|
+
<div class="method-description">
|
1069
|
+
|
1070
|
+
<p>
|
1071
|
+
Pass any unknown function directoy to the @time variable.
|
1072
|
+
</p>
|
1073
|
+
|
1074
|
+
<p><a class="source-toggle" href="#"
|
1075
|
+
onclick="toggleCode('M000902-source');return false;">[Source]</a></p>
|
1076
|
+
<div class="method-source-code" id="M000902-source">
|
1077
|
+
<pre>
|
1078
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 354</span>
|
1079
|
+
354: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">func</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
1080
|
+
355: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">method</span>(<span class="ruby-identifier">func</span>).<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
1081
|
+
356: <span class="ruby-keyword kw">end</span>
|
1082
|
+
</pre>
|
1083
|
+
</div>
|
1084
|
+
|
1085
|
+
</div>
|
1086
|
+
</div>
|
1087
|
+
|
1088
|
+
|
1089
|
+
<div id="method-M000877" class="method-detail">
|
1090
|
+
<a name="M000877"></a>
|
1091
|
+
|
1092
|
+
<div class="method-heading">
|
1093
|
+
|
1094
|
+
<a href="#M000877" class="method-signature">
|
1095
|
+
|
1096
|
+
<span class="method-name">midnight</span><span class="method-args">()</span>
|
1097
|
+
|
1098
|
+
</a>
|
1099
|
+
|
1100
|
+
</div>
|
1101
|
+
|
1102
|
+
<div class="method-description">
|
1103
|
+
|
1104
|
+
<p>
|
1105
|
+
Normalize time to the beginning of the current day.
|
1106
|
+
</p>
|
1107
|
+
|
1108
|
+
<p><a class="source-toggle" href="#"
|
1109
|
+
onclick="toggleCode('M000877-source');return false;">[Source]</a></p>
|
1110
|
+
<div class="method-source-code" id="M000877-source">
|
1111
|
+
<pre>
|
1112
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 146</span>
|
1113
|
+
146: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">midnight</span>
|
1114
|
+
147: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1115
|
+
148: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
1116
|
+
149: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
1117
|
+
150: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
1118
|
+
151: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
1119
|
+
152: <span class="ruby-keyword kw">end</span>
|
1120
|
+
</pre>
|
1121
|
+
</div>
|
1122
|
+
|
1123
|
+
</div>
|
1124
|
+
</div>
|
1125
|
+
|
1126
|
+
|
1127
|
+
<div id="method-M000900" class="method-detail">
|
1128
|
+
<a name="M000900"></a>
|
1129
|
+
|
1130
|
+
<div class="method-heading">
|
1131
|
+
|
1132
|
+
<a href="#M000900" class="method-signature">
|
1133
|
+
|
1134
|
+
<span class="method-name">monthAndYear</span><span class="method-args">()</span>
|
1135
|
+
|
1136
|
+
</a>
|
1137
|
+
|
1138
|
+
</div>
|
1139
|
+
|
1140
|
+
<div class="method-description">
|
1141
|
+
|
1142
|
+
<p>
|
1143
|
+
Return the abbreviated month name and the full year. E. g. ‘Feb
|
1144
|
+
1972’.
|
1145
|
+
</p>
|
1146
|
+
|
1147
|
+
<p><a class="source-toggle" href="#"
|
1148
|
+
onclick="toggleCode('M000900-source');return false;">[Source]</a></p>
|
1149
|
+
<div class="method-source-code" id="M000900-source">
|
1150
|
+
<pre>
|
1151
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 344</span>
|
1152
|
+
344: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">monthAndYear</span>
|
1153
|
+
345: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%b %Y'</span>)
|
1154
|
+
346: <span class="ruby-keyword kw">end</span>
|
1155
|
+
</pre>
|
1156
|
+
</div>
|
1157
|
+
|
1158
|
+
</div>
|
1159
|
+
</div>
|
1160
|
+
|
1161
|
+
|
1162
|
+
<div id="method-M000892" class="method-detail">
|
1163
|
+
<a name="M000892"></a>
|
1164
|
+
|
1165
|
+
<div class="method-heading">
|
1166
|
+
|
1167
|
+
<a href="#M000892" class="method-signature">
|
1168
|
+
|
1169
|
+
<span class="method-name">monthsTo</span><span class="method-args">(date)</span>
|
1170
|
+
|
1171
|
+
</a>
|
1172
|
+
|
1173
|
+
</div>
|
1174
|
+
|
1175
|
+
<div class="method-description">
|
1176
|
+
|
1177
|
+
<p>
|
1178
|
+
Return the number of months between this time and <em>date</em>. The result
|
1179
|
+
is always rounded up.
|
1180
|
+
</p>
|
1181
|
+
|
1182
|
+
<p><a class="source-toggle" href="#"
|
1183
|
+
onclick="toggleCode('M000892-source');return false;">[Source]</a></p>
|
1184
|
+
<div class="method-source-code" id="M000892-source">
|
1185
|
+
<pre>
|
1186
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 295</span>
|
1187
|
+
295: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">monthsTo</span>(<span class="ruby-identifier">date</span>)
|
1188
|
+
296: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">:sameTimeNextMonth</span>)
|
1189
|
+
297: <span class="ruby-keyword kw">end</span>
|
1190
|
+
</pre>
|
1191
|
+
</div>
|
1192
|
+
|
1193
|
+
</div>
|
1194
|
+
</div>
|
1195
|
+
|
1196
|
+
|
1197
|
+
<div id="method-M000898" class="method-detail">
|
1198
|
+
<a name="M000898"></a>
|
1199
|
+
|
1200
|
+
<div class="method-heading">
|
1201
|
+
|
1202
|
+
<a href="#M000898" class="method-signature">
|
1203
|
+
|
1204
|
+
<span class="method-name">quarterName</span><span class="method-args">()</span>
|
1205
|
+
|
1206
|
+
</a>
|
1207
|
+
|
1208
|
+
</div>
|
1209
|
+
|
1210
|
+
<div class="method-description">
|
1211
|
+
|
1212
|
+
<p>
|
1213
|
+
Return the number of the quarter prefixed by a ‘Q’.
|
1214
|
+
</p>
|
1215
|
+
|
1216
|
+
<p><a class="source-toggle" href="#"
|
1217
|
+
onclick="toggleCode('M000898-source');return false;">[Source]</a></p>
|
1218
|
+
<div class="method-source-code" id="M000898-source">
|
1219
|
+
<pre>
|
1220
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 333</span>
|
1221
|
+
333: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quarterName</span>
|
1222
|
+
334: <span class="ruby-node">"Q#{(@time.mon / 3) + 1}"</span>
|
1223
|
+
335: <span class="ruby-keyword kw">end</span>
|
1224
|
+
</pre>
|
1225
|
+
</div>
|
1226
|
+
|
1227
|
+
</div>
|
1228
|
+
</div>
|
1229
|
+
|
1230
|
+
|
1231
|
+
<div id="method-M000893" class="method-detail">
|
1232
|
+
<a name="M000893"></a>
|
1233
|
+
|
1234
|
+
<div class="method-heading">
|
1235
|
+
|
1236
|
+
<a href="#M000893" class="method-signature">
|
1237
|
+
|
1238
|
+
<span class="method-name">quartersTo</span><span class="method-args">(date)</span>
|
1239
|
+
|
1240
|
+
</a>
|
1241
|
+
|
1242
|
+
</div>
|
1243
|
+
|
1244
|
+
<div class="method-description">
|
1245
|
+
|
1246
|
+
<p>
|
1247
|
+
Return the number of quarters between this time and <em>date</em>. The
|
1248
|
+
result is always rounded up.
|
1249
|
+
</p>
|
1250
|
+
|
1251
|
+
<p><a class="source-toggle" href="#"
|
1252
|
+
onclick="toggleCode('M000893-source');return false;">[Source]</a></p>
|
1253
|
+
<div class="method-source-code" id="M000893-source">
|
1254
|
+
<pre>
|
1255
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 301</span>
|
1256
|
+
301: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quartersTo</span>(<span class="ruby-identifier">date</span>)
|
1257
|
+
302: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">:sameTimeNextQuarter</span>)
|
1258
|
+
303: <span class="ruby-keyword kw">end</span>
|
1259
|
+
</pre>
|
1260
|
+
</div>
|
1261
|
+
|
1262
|
+
</div>
|
1263
|
+
</div>
|
1264
|
+
|
1265
|
+
|
1266
|
+
<div id="method-M000884" class="method-detail">
|
1267
|
+
<a name="M000884"></a>
|
1268
|
+
|
1269
|
+
<div class="method-heading">
|
1270
|
+
|
1271
|
+
<a href="#M000884" class="method-signature">
|
1272
|
+
|
1273
|
+
<span class="method-name">sameTimeNextDay</span><span class="method-args">()</span>
|
1274
|
+
|
1275
|
+
</a>
|
1276
|
+
|
1277
|
+
</div>
|
1278
|
+
|
1279
|
+
<div class="method-description">
|
1280
|
+
|
1281
|
+
<p>
|
1282
|
+
Return a new time that is 1 day later than time but at the same time of
|
1283
|
+
day.
|
1284
|
+
</p>
|
1285
|
+
|
1286
|
+
<p><a class="source-toggle" href="#"
|
1287
|
+
onclick="toggleCode('M000884-source');return false;">[Source]</a></p>
|
1288
|
+
<div class="method-source-code" id="M000884-source">
|
1289
|
+
<pre>
|
1290
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 212</span>
|
1291
|
+
212: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextDay</span>
|
1292
|
+
213: <span class="ruby-identifier">delta</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">-1</span>, <span class="ruby-value">1</span> ]
|
1293
|
+
214: <span class="ruby-identifier">localT1</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1294
|
+
215: <span class="ruby-identifier">delta</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
1295
|
+
216: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> (<span class="ruby-value">24</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">d</span>) <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
1296
|
+
217: <span class="ruby-identifier">localT2</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1297
|
+
218: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">localT1</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">localT2</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>]
|
1298
|
+
219: <span class="ruby-keyword kw">end</span>
|
1299
|
+
220: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Algorithm is broken for #{@time}"</span>
|
1300
|
+
221: <span class="ruby-keyword kw">end</span>
|
1301
|
+
</pre>
|
1302
|
+
</div>
|
1303
|
+
|
1304
|
+
</div>
|
1305
|
+
</div>
|
1306
|
+
|
1307
|
+
|
1308
|
+
<div id="method-M000883" class="method-detail">
|
1309
|
+
<a name="M000883"></a>
|
1310
|
+
|
1311
|
+
<div class="method-heading">
|
1312
|
+
|
1313
|
+
<a href="#M000883" class="method-signature">
|
1314
|
+
|
1315
|
+
<span class="method-name">sameTimeNextHour</span><span class="method-args">()</span>
|
1316
|
+
|
1317
|
+
</a>
|
1318
|
+
|
1319
|
+
</div>
|
1320
|
+
|
1321
|
+
<div class="method-description">
|
1322
|
+
|
1323
|
+
<p>
|
1324
|
+
Return a new time that is 1 hour later than time.
|
1325
|
+
</p>
|
1326
|
+
|
1327
|
+
<p><a class="source-toggle" href="#"
|
1328
|
+
onclick="toggleCode('M000883-source');return false;">[Source]</a></p>
|
1329
|
+
<div class="method-source-code" id="M000883-source">
|
1330
|
+
<pre>
|
1331
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 206</span>
|
1332
|
+
206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextHour</span>
|
1333
|
+
207: <span class="ruby-identifier">hoursLater</span>(<span class="ruby-value">1</span>)
|
1334
|
+
208: <span class="ruby-keyword kw">end</span>
|
1335
|
+
</pre>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
</div>
|
1339
|
+
</div>
|
1340
|
+
|
1341
|
+
|
1342
|
+
<div id="method-M000886" class="method-detail">
|
1343
|
+
<a name="M000886"></a>
|
1344
|
+
|
1345
|
+
<div class="method-heading">
|
1346
|
+
|
1347
|
+
<a href="#M000886" class="method-signature">
|
1348
|
+
|
1349
|
+
<span class="method-name">sameTimeNextMonth</span><span class="method-args">()</span>
|
1350
|
+
|
1351
|
+
</a>
|
1352
|
+
|
1353
|
+
</div>
|
1354
|
+
|
1355
|
+
<div class="method-description">
|
1356
|
+
|
1357
|
+
<p>
|
1358
|
+
Return a new time that is 1 month later than time but at the same time of
|
1359
|
+
day.
|
1360
|
+
</p>
|
1361
|
+
|
1362
|
+
<p><a class="source-toggle" href="#"
|
1363
|
+
onclick="toggleCode('M000886-source');return false;">[Source]</a></p>
|
1364
|
+
<div class="method-source-code" id="M000886-source">
|
1365
|
+
<pre>
|
1366
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 238</span>
|
1367
|
+
238: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextMonth</span>
|
1368
|
+
239: <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">year</span>, <span class="ruby-identifier">wday</span>, <span class="ruby-identifier">yday</span>, <span class="ruby-identifier">isdst</span>, <span class="ruby-identifier">tz</span> =
|
1369
|
+
240: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1370
|
+
241: <span class="ruby-identifier">monMax</span> = <span class="ruby-identifier">month</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">leapYear?</span>(<span class="ruby-identifier">year</span>) <span class="ruby-operator">?</span> <span class="ruby-value">29</span> <span class="ruby-operator">:</span> <span class="ruby-constant">MON_MAX</span>[<span class="ruby-identifier">month</span>]
|
1371
|
+
242: <span class="ruby-identifier">month</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1372
|
+
243: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
1373
|
+
244: <span class="ruby-identifier">month</span> = <span class="ruby-value">1</span>
|
1374
|
+
245: <span class="ruby-identifier">year</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1375
|
+
246: <span class="ruby-keyword kw">end</span>
|
1376
|
+
247: <span class="ruby-identifier">day</span> = <span class="ruby-identifier">monMax</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">day</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">monMax</span>
|
1377
|
+
248: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-value">0</span>))
|
1378
|
+
249: <span class="ruby-keyword kw">end</span>
|
1379
|
+
</pre>
|
1380
|
+
</div>
|
1381
|
+
|
1382
|
+
</div>
|
1383
|
+
</div>
|
1384
|
+
|
1385
|
+
|
1386
|
+
<div id="method-M000887" class="method-detail">
|
1387
|
+
<a name="M000887"></a>
|
1388
|
+
|
1389
|
+
<div class="method-heading">
|
1390
|
+
|
1391
|
+
<a href="#M000887" class="method-signature">
|
1392
|
+
|
1393
|
+
<span class="method-name">sameTimeNextQuarter</span><span class="method-args">()</span>
|
1394
|
+
|
1395
|
+
</a>
|
1396
|
+
|
1397
|
+
</div>
|
1398
|
+
|
1399
|
+
<div class="method-description">
|
1400
|
+
|
1401
|
+
<p>
|
1402
|
+
Return a new time that is 1 quarter later than time but at the same time of
|
1403
|
+
day.
|
1404
|
+
</p>
|
1405
|
+
|
1406
|
+
<p><a class="source-toggle" href="#"
|
1407
|
+
onclick="toggleCode('M000887-source');return false;">[Source]</a></p>
|
1408
|
+
<div class="method-source-code" id="M000887-source">
|
1409
|
+
<pre>
|
1410
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 253</span>
|
1411
|
+
253: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextQuarter</span>
|
1412
|
+
254: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1413
|
+
255: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">3</span>) <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
1414
|
+
256: <span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">-=</span> <span class="ruby-value">12</span>
|
1415
|
+
257: <span class="ruby-identifier">t</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1416
|
+
258: <span class="ruby-keyword kw">end</span>
|
1417
|
+
259: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
1418
|
+
260: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
1419
|
+
261: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
1420
|
+
262: <span class="ruby-keyword kw">end</span>
|
1421
|
+
</pre>
|
1422
|
+
</div>
|
1423
|
+
|
1424
|
+
</div>
|
1425
|
+
</div>
|
1426
|
+
|
1427
|
+
|
1428
|
+
<div id="method-M000885" class="method-detail">
|
1429
|
+
<a name="M000885"></a>
|
1430
|
+
|
1431
|
+
<div class="method-heading">
|
1432
|
+
|
1433
|
+
<a href="#M000885" class="method-signature">
|
1434
|
+
|
1435
|
+
<span class="method-name">sameTimeNextWeek</span><span class="method-args">()</span>
|
1436
|
+
|
1437
|
+
</a>
|
1438
|
+
|
1439
|
+
</div>
|
1440
|
+
|
1441
|
+
<div class="method-description">
|
1442
|
+
|
1443
|
+
<p>
|
1444
|
+
Return a new time that is 1 week later than time but at the same time of
|
1445
|
+
day.
|
1446
|
+
</p>
|
1447
|
+
|
1448
|
+
<p><a class="source-toggle" href="#"
|
1449
|
+
onclick="toggleCode('M000885-source');return false;">[Source]</a></p>
|
1450
|
+
<div class="method-source-code" id="M000885-source">
|
1451
|
+
<pre>
|
1452
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 225</span>
|
1453
|
+
225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextWeek</span>
|
1454
|
+
226: <span class="ruby-identifier">delta</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">-1</span>, <span class="ruby-value">1</span> ]
|
1455
|
+
227: <span class="ruby-identifier">localT1</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1456
|
+
228: <span class="ruby-identifier">delta</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
1457
|
+
229: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> (<span class="ruby-value">7</span> <span class="ruby-operator">*</span> <span class="ruby-value">24</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">d</span>) <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
1458
|
+
230: <span class="ruby-identifier">localT2</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1459
|
+
231: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">localT1</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">localT2</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>]
|
1460
|
+
232: <span class="ruby-keyword kw">end</span>
|
1461
|
+
233: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Algorithm is broken for #{@time}"</span>
|
1462
|
+
234: <span class="ruby-keyword kw">end</span>
|
1463
|
+
</pre>
|
1464
|
+
</div>
|
1465
|
+
|
1466
|
+
</div>
|
1467
|
+
</div>
|
1468
|
+
|
1469
|
+
|
1470
|
+
<div id="method-M000888" class="method-detail">
|
1471
|
+
<a name="M000888"></a>
|
1472
|
+
|
1473
|
+
<div class="method-heading">
|
1474
|
+
|
1475
|
+
<a href="#M000888" class="method-signature">
|
1476
|
+
|
1477
|
+
<span class="method-name">sameTimeNextYear</span><span class="method-args">()</span>
|
1478
|
+
|
1479
|
+
</a>
|
1480
|
+
|
1481
|
+
</div>
|
1482
|
+
|
1483
|
+
<div class="method-description">
|
1484
|
+
|
1485
|
+
<p>
|
1486
|
+
Return a new time that is 1 year later than time but at the same time of
|
1487
|
+
day.
|
1488
|
+
</p>
|
1489
|
+
|
1490
|
+
<p><a class="source-toggle" href="#"
|
1491
|
+
onclick="toggleCode('M000888-source');return false;">[Source]</a></p>
|
1492
|
+
<div class="method-source-code" id="M000888-source">
|
1493
|
+
<pre>
|
1494
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 266</span>
|
1495
|
+
266: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextYear</span>
|
1496
|
+
267: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
1497
|
+
268: <span class="ruby-identifier">t</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1498
|
+
269: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
1499
|
+
270: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
1500
|
+
271: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">t</span>))
|
1501
|
+
272: <span class="ruby-keyword kw">end</span>
|
1502
|
+
</pre>
|
1503
|
+
</div>
|
1504
|
+
|
1505
|
+
</div>
|
1506
|
+
</div>
|
1507
|
+
|
1508
|
+
|
1509
|
+
<div id="method-M000865" class="method-detail">
|
1510
|
+
<a name="M000865"></a>
|
1511
|
+
|
1512
|
+
<div class="method-heading">
|
1513
|
+
|
1514
|
+
<a href="#M000865" class="method-signature">
|
1515
|
+
|
1516
|
+
<span class="method-name">secondsOfDay</span><span class="method-args">(tz = nil)</span>
|
1517
|
+
|
1518
|
+
</a>
|
1519
|
+
|
1520
|
+
</div>
|
1521
|
+
|
1522
|
+
<div class="method-description">
|
1523
|
+
|
1524
|
+
<p>
|
1525
|
+
Returns the total number of seconds of the day. The time is assumed to be
|
1526
|
+
in the time zone specified by <em>tz</em>.
|
1527
|
+
</p>
|
1528
|
+
|
1529
|
+
<p><a class="source-toggle" href="#"
|
1530
|
+
onclick="toggleCode('M000865-source');return false;">[Source]</a></p>
|
1531
|
+
<div class="method-source-code" id="M000865-source">
|
1532
|
+
<pre>
|
1533
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 70</span>
|
1534
|
+
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">secondsOfDay</span>(<span class="ruby-identifier">tz</span> = <span class="ruby-keyword kw">nil</span>)
|
1535
|
+
71: <span class="ruby-comment cmt"># TODO: Add timezone support</span>
|
1536
|
+
72: (<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">gmt_offset</span>) <span class="ruby-operator">%</span> (<span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">24</span>)
|
1537
|
+
73: <span class="ruby-keyword kw">end</span>
|
1538
|
+
</pre>
|
1539
|
+
</div>
|
1540
|
+
|
1541
|
+
</div>
|
1542
|
+
</div>
|
1543
|
+
|
1544
|
+
|
1545
|
+
<div id="method-M000897" class="method-detail">
|
1546
|
+
<a name="M000897"></a>
|
1547
|
+
|
1548
|
+
<div class="method-heading">
|
1549
|
+
|
1550
|
+
<a href="#M000897" class="method-signature">
|
1551
|
+
|
1552
|
+
<span class="method-name">shortMonthName</span><span class="method-args">()</span>
|
1553
|
+
|
1554
|
+
</a>
|
1555
|
+
|
1556
|
+
</div>
|
1557
|
+
|
1558
|
+
<div class="method-description">
|
1559
|
+
|
1560
|
+
<p>
|
1561
|
+
Return the abbreviated month name.
|
1562
|
+
</p>
|
1563
|
+
|
1564
|
+
<p><a class="source-toggle" href="#"
|
1565
|
+
onclick="toggleCode('M000897-source');return false;">[Source]</a></p>
|
1566
|
+
<div class="method-source-code" id="M000897-source">
|
1567
|
+
<pre>
|
1568
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 328</span>
|
1569
|
+
328: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shortMonthName</span>
|
1570
|
+
329: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%b'</span>)
|
1571
|
+
330: <span class="ruby-keyword kw">end</span>
|
1572
|
+
</pre>
|
1573
|
+
</div>
|
1574
|
+
|
1575
|
+
</div>
|
1576
|
+
</div>
|
1577
|
+
|
1578
|
+
|
1579
|
+
<div id="method-M000896" class="method-detail">
|
1580
|
+
<a name="M000896"></a>
|
1581
|
+
|
1582
|
+
<div class="method-heading">
|
1583
|
+
|
1584
|
+
<a href="#M000896" class="method-signature">
|
1585
|
+
|
1586
|
+
<span class="method-name">to_i</span><span class="method-args">()</span>
|
1587
|
+
|
1588
|
+
</a>
|
1589
|
+
|
1590
|
+
</div>
|
1591
|
+
|
1592
|
+
<div class="method-description">
|
1593
|
+
|
1594
|
+
<p>
|
1595
|
+
Return the seconds since Epoch.
|
1596
|
+
</p>
|
1597
|
+
|
1598
|
+
<p><a class="source-toggle" href="#"
|
1599
|
+
onclick="toggleCode('M000896-source');return false;">[Source]</a></p>
|
1600
|
+
<div class="method-source-code" id="M000896-source">
|
1601
|
+
<pre>
|
1602
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 323</span>
|
1603
|
+
323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
1604
|
+
324: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span>
|
1605
|
+
325: <span class="ruby-keyword kw">end</span>
|
1606
|
+
</pre>
|
1607
|
+
</div>
|
1608
|
+
|
1609
|
+
</div>
|
1610
|
+
</div>
|
1611
|
+
|
1612
|
+
|
1613
|
+
<div id="method-M000895" class="method-detail">
|
1614
|
+
<a name="M000895"></a>
|
1615
|
+
|
1616
|
+
<div class="method-heading">
|
1617
|
+
|
1618
|
+
<a href="#M000895" class="method-signature">
|
1619
|
+
|
1620
|
+
<span class="method-name">to_s</span><span class="method-args">(format = nil)</span>
|
1621
|
+
|
1622
|
+
</a>
|
1623
|
+
|
1624
|
+
</div>
|
1625
|
+
|
1626
|
+
<div class="method-description">
|
1627
|
+
|
1628
|
+
<p>
|
1629
|
+
This function is just a wrapper around Time.strftime(). In case @time is
|
1630
|
+
nil, it returns ‘unkown’.
|
1631
|
+
</p>
|
1632
|
+
|
1633
|
+
<p><a class="source-toggle" href="#"
|
1634
|
+
onclick="toggleCode('M000895-source');return false;">[Source]</a></p>
|
1635
|
+
<div class="method-source-code" id="M000895-source">
|
1636
|
+
<pre>
|
1637
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 313</span>
|
1638
|
+
313: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>(<span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)
|
1639
|
+
314: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'unknown'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">nil?</span>
|
1640
|
+
315: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">nil?</span>
|
1641
|
+
316: <span class="ruby-identifier">format</span> = <span class="ruby-value str">'%Y-%m-%d-%H:%M'</span> <span class="ruby-operator">+</span> (<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">sec</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-value str">':%s'</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'-%z'</span>
|
1642
|
+
317: <span class="ruby-keyword kw">end</span>
|
1643
|
+
318: <span class="ruby-comment cmt"># Always report values in local timezone</span>
|
1644
|
+
319: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">clone</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">format</span>)
|
1645
|
+
320: <span class="ruby-keyword kw">end</span>
|
1646
|
+
</pre>
|
1647
|
+
</div>
|
1648
|
+
|
1649
|
+
</div>
|
1650
|
+
</div>
|
1651
|
+
|
1652
|
+
|
1653
|
+
<div id="method-M000875" class="method-detail">
|
1654
|
+
<a name="M000875"></a>
|
1655
|
+
|
1656
|
+
<div class="method-heading">
|
1657
|
+
|
1658
|
+
<a href="#M000875" class="method-signature">
|
1659
|
+
|
1660
|
+
<span class="method-name">upto</span><span class="method-args">(endDate, step = 1) {|TjTime.new(t)| ...}</span>
|
1661
|
+
|
1662
|
+
</a>
|
1663
|
+
|
1664
|
+
</div>
|
1665
|
+
|
1666
|
+
<div class="method-description">
|
1667
|
+
|
1668
|
+
<p>
|
1669
|
+
Iterator that executes the block until time has reached <em>endDate</em>
|
1670
|
+
increasing time by <em>step</em> on each iteration.
|
1671
|
+
</p>
|
1672
|
+
|
1673
|
+
<p><a class="source-toggle" href="#"
|
1674
|
+
onclick="toggleCode('M000875-source');return false;">[Source]</a></p>
|
1675
|
+
<div class="method-source-code" id="M000875-source">
|
1676
|
+
<pre>
|
1677
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 128</span>
|
1678
|
+
128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upto</span>(<span class="ruby-identifier">endDate</span>, <span class="ruby-identifier">step</span> = <span class="ruby-value">1</span>)
|
1679
|
+
129: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>
|
1680
|
+
130: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">t</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">endDate</span>.<span class="ruby-identifier">time</span>
|
1681
|
+
131: <span class="ruby-keyword kw">yield</span>(<span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>))
|
1682
|
+
132: <span class="ruby-identifier">t</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">step</span>
|
1683
|
+
133: <span class="ruby-keyword kw">end</span>
|
1684
|
+
134: <span class="ruby-keyword kw">end</span>
|
1685
|
+
</pre>
|
1686
|
+
</div>
|
1687
|
+
|
1688
|
+
</div>
|
1689
|
+
</div>
|
1690
|
+
|
1691
|
+
|
1692
|
+
<div id="method-M000899" class="method-detail">
|
1693
|
+
<a name="M000899"></a>
|
1694
|
+
|
1695
|
+
<div class="method-heading">
|
1696
|
+
|
1697
|
+
<a href="#M000899" class="method-signature">
|
1698
|
+
|
1699
|
+
<span class="method-name">week</span><span class="method-args">(weekStartsMonday)</span>
|
1700
|
+
|
1701
|
+
</a>
|
1702
|
+
|
1703
|
+
</div>
|
1704
|
+
|
1705
|
+
<div class="method-description">
|
1706
|
+
|
1707
|
+
<p>
|
1708
|
+
Return the week number. <em>weekStartsMonday</em> specifies wheter the
|
1709
|
+
counting should be for weeks starting Mondays or Sundays.
|
1710
|
+
</p>
|
1711
|
+
|
1712
|
+
<p><a class="source-toggle" href="#"
|
1713
|
+
onclick="toggleCode('M000899-source');return false;">[Source]</a></p>
|
1714
|
+
<div class="method-source-code" id="M000899-source">
|
1715
|
+
<pre>
|
1716
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 339</span>
|
1717
|
+
339: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">week</span>(<span class="ruby-identifier">weekStartsMonday</span>)
|
1718
|
+
340: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">weekStartsMonday</span> <span class="ruby-value">? </span><span class="ruby-value str">'%W'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'%U'</span>)
|
1719
|
+
341: <span class="ruby-keyword kw">end</span>
|
1720
|
+
</pre>
|
1721
|
+
</div>
|
1722
|
+
|
1723
|
+
</div>
|
1724
|
+
</div>
|
1725
|
+
|
1726
|
+
|
1727
|
+
<div id="method-M000901" class="method-detail">
|
1728
|
+
<a name="M000901"></a>
|
1729
|
+
|
1730
|
+
<div class="method-heading">
|
1731
|
+
|
1732
|
+
<a href="#M000901" class="method-signature">
|
1733
|
+
|
1734
|
+
<span class="method-name">weekdayAndDate</span><span class="method-args">()</span>
|
1735
|
+
|
1736
|
+
</a>
|
1737
|
+
|
1738
|
+
</div>
|
1739
|
+
|
1740
|
+
<div class="method-description">
|
1741
|
+
|
1742
|
+
<p>
|
1743
|
+
Return the abbreviated weekday and the full date. E. g. ‘Sat
|
1744
|
+
2007-11-03’.
|
1745
|
+
</p>
|
1746
|
+
|
1747
|
+
<p><a class="source-toggle" href="#"
|
1748
|
+
onclick="toggleCode('M000901-source');return false;">[Source]</a></p>
|
1749
|
+
<div class="method-source-code" id="M000901-source">
|
1750
|
+
<pre>
|
1751
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 349</span>
|
1752
|
+
349: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">weekdayAndDate</span>
|
1753
|
+
350: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%A %Y-%m-%d'</span>)
|
1754
|
+
351: <span class="ruby-keyword kw">end</span>
|
1755
|
+
</pre>
|
1756
|
+
</div>
|
1757
|
+
|
1758
|
+
</div>
|
1759
|
+
</div>
|
1760
|
+
|
1761
|
+
|
1762
|
+
<div id="method-M000891" class="method-detail">
|
1763
|
+
<a name="M000891"></a>
|
1764
|
+
|
1765
|
+
<div class="method-heading">
|
1766
|
+
|
1767
|
+
<a href="#M000891" class="method-signature">
|
1768
|
+
|
1769
|
+
<span class="method-name">weeksTo</span><span class="method-args">(date)</span>
|
1770
|
+
|
1771
|
+
</a>
|
1772
|
+
|
1773
|
+
</div>
|
1774
|
+
|
1775
|
+
<div class="method-description">
|
1776
|
+
|
1777
|
+
<p>
|
1778
|
+
Return the number of weeks between this time and <em>date</em>. The result
|
1779
|
+
is always rounded up.
|
1780
|
+
</p>
|
1781
|
+
|
1782
|
+
<p><a class="source-toggle" href="#"
|
1783
|
+
onclick="toggleCode('M000891-source');return false;">[Source]</a></p>
|
1784
|
+
<div class="method-source-code" id="M000891-source">
|
1785
|
+
<pre>
|
1786
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 289</span>
|
1787
|
+
289: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">weeksTo</span>(<span class="ruby-identifier">date</span>)
|
1788
|
+
290: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">:sameTimeNextWeek</span>)
|
1789
|
+
291: <span class="ruby-keyword kw">end</span>
|
1790
|
+
</pre>
|
1791
|
+
</div>
|
1792
|
+
|
1793
|
+
</div>
|
1794
|
+
</div>
|
1795
|
+
|
1796
|
+
|
1797
|
+
<div id="method-M000894" class="method-detail">
|
1798
|
+
<a name="M000894"></a>
|
1799
|
+
|
1800
|
+
<div class="method-heading">
|
1801
|
+
|
1802
|
+
<a href="#M000894" class="method-signature">
|
1803
|
+
|
1804
|
+
<span class="method-name">yearsTo</span><span class="method-args">(date)</span>
|
1805
|
+
|
1806
|
+
</a>
|
1807
|
+
|
1808
|
+
</div>
|
1809
|
+
|
1810
|
+
<div class="method-description">
|
1811
|
+
|
1812
|
+
<p>
|
1813
|
+
Return the number of years between this time and <em>date</em>. The result
|
1814
|
+
is always rounded up.
|
1815
|
+
</p>
|
1816
|
+
|
1817
|
+
<p><a class="source-toggle" href="#"
|
1818
|
+
onclick="toggleCode('M000894-source');return false;">[Source]</a></p>
|
1819
|
+
<div class="method-source-code" id="M000894-source">
|
1820
|
+
<pre>
|
1821
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 307</span>
|
1822
|
+
307: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">yearsTo</span>(<span class="ruby-identifier">date</span>)
|
1823
|
+
308: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">:sameTimeNextYear</span>)
|
1824
|
+
309: <span class="ruby-keyword kw">end</span>
|
1825
|
+
</pre>
|
1826
|
+
</div>
|
1827
|
+
|
1828
|
+
</div>
|
1829
|
+
</div>
|
1830
|
+
|
1831
|
+
|
1832
|
+
|
1833
|
+
</div>
|
1834
|
+
|
1835
|
+
|
1836
|
+
|
1837
|
+
|
1838
|
+
</div>
|
1839
|
+
|
1840
|
+
<div id="validator-badges">
|
1841
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
1842
|
+
</div>
|
1843
|
+
|
1844
|
+
</body>
|
1845
|
+
</html>
|