Class: DateHolidays::Reader::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/date_holidays/reader/config.rb

Overview

Tells the gem how to interact with Node and provides a list of countries. See the configuration section of the Readme for more inforamtion.

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node_path: nil) ⇒ Config

Returns a new instance of Config.



39
40
41
42
43
# File 'lib/date_holidays/reader/config.rb', line 39

def initialize(node_path: nil)
  @node_path = node_path

  freeze
end

Class Attribute Details

.defaultObject



28
29
30
# File 'lib/date_holidays/reader/config.rb', line 28

def default
  @default ||= new(node_path: node_path)
end

.node_pathObject

Returns the value of attribute node_path.



19
20
21
# File 'lib/date_holidays/reader/config.rb', line 19

def node_path
  @node_path
end

Instance Attribute Details

#node_pathObject (readonly)

Returns the value of attribute node_path.



37
38
39
# File 'lib/date_holidays/reader/config.rb', line 37

def node_path
  @node_path
end

Class Method Details

.countriesObject



32
33
34
# File 'lib/date_holidays/reader/config.rb', line 32

def countries
  JsBridge.new.extract(:countries)
end

Instance Method Details

#native_linux?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/date_holidays/reader/config.rb', line 49

def native_linux?
  OS.linux? && OS.bits == SUPPORTED_CPU_BITS
end

#native_mac?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/date_holidays/reader/config.rb', line 45

def native_mac?
  OS.osx? && OS.bits == SUPPORTED_CPU_BITS
end