Class: Autodiscover::ServerVersionParser
- Inherits:
-
Object
- Object
- Autodiscover::ServerVersionParser
- Defined in:
- lib/autodiscover/server_version_parser.rb
Constant Summary collapse
- VERSIONS =
{ 8 => { 0 => "Exchange2007", 1 => "Exchange2007_SP1", 2 => "Exchange2007_SP1", 3 => "Exchange2007_SP1", }, 14 => { 0 => "Exchange2010", 1 => "Exchange2010_SP1", 2 => "Exchange2010_SP2", 3 => "Exchange2010_SP2", }, 15 => { 0 => "Exchange2013", 1 => "Exchange2013_SP1", } }
Instance Method Summary collapse
- #build ⇒ Object
- #exchange_version ⇒ Object
-
#initialize(hexversion) ⇒ ServerVersionParser
constructor
A new instance of ServerVersionParser.
- #major ⇒ Object
- #minor ⇒ Object
Constructor Details
#initialize(hexversion) ⇒ ServerVersionParser
Returns a new instance of ServerVersionParser.
23 24 25 |
# File 'lib/autodiscover/server_version_parser.rb', line 23 def initialize(hexversion) @version = hexversion.hex.to_s(2).rjust(hexversion.size*4, '0') end |
Instance Method Details
#build ⇒ Object
35 36 37 |
# File 'lib/autodiscover/server_version_parser.rb', line 35 def build @version[17..31].to_i(2) end |
#exchange_version ⇒ Object
39 40 41 42 |
# File 'lib/autodiscover/server_version_parser.rb', line 39 def exchange_version v = VERSIONS[major][minor] v.nil? ? VERIONS[8][0] : v end |
#major ⇒ Object
27 28 29 |
# File 'lib/autodiscover/server_version_parser.rb', line 27 def major @version[4..9].to_i(2) end |
#minor ⇒ Object
31 32 33 |
# File 'lib/autodiscover/server_version_parser.rb', line 31 def minor @version[10..15].to_i(2) end |