Class: FancyVersion::Dictionary
- Inherits:
-
Object
- Object
- FancyVersion::Dictionary
- Defined in:
- lib/fancy_version/codename.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
-
#revision ⇒ Object
Returns the value of attribute revision.
Instance Method Summary collapse
-
#initialize(dict_major, dict_minor, dict_revision) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #try(dict, idx) ⇒ Object
Constructor Details
#initialize(dict_major, dict_minor, dict_revision) ⇒ Dictionary
Returns a new instance of Dictionary.
6 7 8 9 10 |
# File 'lib/fancy_version/codename.rb', line 6 def initialize( dict_major, dict_minor, dict_revision ) self.major = dict_major self.minor = dict_minor self.revision = dict_revision end |
Instance Attribute Details
#major ⇒ Object
Returns the value of attribute major.
4 5 6 |
# File 'lib/fancy_version/codename.rb', line 4 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
4 5 6 |
# File 'lib/fancy_version/codename.rb', line 4 def minor @minor end |
#revision ⇒ Object
Returns the value of attribute revision.
4 5 6 |
# File 'lib/fancy_version/codename.rb', line 4 def revision @revision end |
Instance Method Details
#try(dict, idx) ⇒ Object
12 13 14 15 |
# File 'lib/fancy_version/codename.rb', line 12 def try( dict, idx ) v = (send dict.to_sym).send :"[]", idx.to_i v.nil? ? idx : v end |