class TandaCLI::Configuration
- TandaCLI::Configuration
- Reference
- Object
Included Modules
- JSON::Serializable
- TandaCLI::Configuration::Macros
Defined in:
tanda_cli/configuration.crtanda_cli/configuration/macros.cr
tanda_cli/configuration/types/access_token.cr
tanda_cli/configuration/types/environment.cr
tanda_cli/configuration/types/organisation.cr
Constant Summary
-
CONFIG_DIR =
"#{Path.home}/.tanda_cli"
-
CONFIG_PATH =
"#{CONFIG_DIR}/config.json"
-
PRODUCTION =
"production"
-
STAGING =
"staging"
Constructors
- .init : Configuration
- .new(pull : JSON::PullParser)
- .new(clockin_photo_path : String | Nil = nil, production : Environment = Environment.new, staging : Environment = Environment.new, mode : String = PRODUCTION, start_of_week : Time::DayOfWeek = Time::DayOfWeek::Monday, treat_paid_breaks_as_unpaid : Bool | Nil = false)
Instance Method Summary
- #access_token : AccessToken
- #access_token=(value : AccessToken)
- #api_url : String
- #clockin_photo_path : String | Nil
- #clockin_photo_path=(clockin_photo_path : String | Nil)
- #current_organisation!(*args, **options)
- #current_organisation!(*args, **options, &)
- #current_organisation?(*args, **options)
- #current_organisation?(*args, **options, &)
- #mode : String
- #mode=(mode : String)
- #organisations : Array(Organisation)
- #organisations=(value : Array(Organisation))
- #overwrite!(site_prefix : String, email : String, access_token : Types::AccessToken)
- #pretty_start_of_week : String
- #reset_environment!
- #save!
- #site_prefix : String
- #site_prefix=(value : String)
- #staging? : Bool
- #start_of_week : Time::DayOfWeek
- #start_of_week=(value : String) : Time::DayOfWeek | Error::InvalidStartOfWeek
-
#time_zone : String | Nil
properties that are delegated based on the current environment
-
#time_zone=(value : String | Nil)
properties that are delegated based on the current environment
-
#treat_paid_breaks_as_unpaid? : Bool | Nil
Secret manual configuration options TODO: Remove this - currently to get around annoying issue where breaks get marked as paid which doesn't work for my needs
Macros inherited from module TandaCLI::Configuration::Macros
environment_property(name)
environment_property
Constructor Detail
def self.new(clockin_photo_path : String | Nil = nil, production : Environment = Environment.new, staging : Environment = Environment.new, mode : String = PRODUCTION, start_of_week : Time::DayOfWeek = Time::DayOfWeek::Monday, treat_paid_breaks_as_unpaid : Bool | Nil = false)
#
Instance Method Detail
def overwrite!(site_prefix : String, email : String, access_token : Types::AccessToken)
#
def time_zone=(value : String | Nil)
#
properties that are delegated based on the current environment
def treat_paid_breaks_as_unpaid? : Bool | Nil
#
Secret manual configuration options
TODO Remove this - currently to get around annoying issue where breaks get marked as paid which doesn't work for my needs