Class: CbNitride::DiamondNumberFormatter
- Inherits:
-
Object
- Object
- CbNitride::DiamondNumberFormatter
- Defined in:
- lib/cb_nitride/diamond_number_formatter.rb
Instance Attribute Summary collapse
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#num ⇒ Object
readonly
Returns the value of attribute num.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(year: year, month: month, num: num) ⇒ DiamondNumberFormatter
constructor
A new instance of DiamondNumberFormatter.
Constructor Details
#initialize(year: year, month: month, num: num) ⇒ DiamondNumberFormatter
Returns a new instance of DiamondNumberFormatter.
9 10 11 12 13 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 9 def initialize(year: year, month: month, num: num) @year = year @month = month @num = num end |
Instance Attribute Details
#month ⇒ Object (readonly)
Returns the value of attribute month.
3 4 5 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 3 def month @month end |
#num ⇒ Object (readonly)
Returns the value of attribute num.
3 4 5 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 3 def num @num end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
3 4 5 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 3 def year @year end |
Class Method Details
.format(year: year, month: month, num: num) ⇒ Object
5 6 7 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 5 def self.format(year: year, month: month, num: num) new(year: year, month: month, num: num).format end |
Instance Method Details
#format ⇒ Object
15 16 17 |
# File 'lib/cb_nitride/diamond_number_formatter.rb', line 15 def format month + year + calculate_zeroes end |