class TandaCLI::Configuration

Included Modules

Defined in:

tanda_cli/configuration.cr
tanda_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

Instance Method Summary

Macros inherited from module TandaCLI::Configuration::Macros

environment_property(name) environment_property

Constructor Detail

def self.init : Configuration #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
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) #

[View source]

Instance Method Detail

def access_token : AccessToken #

[View source]
def access_token=(value : AccessToken) #

[View source]
def api_url : String #

[View source]
def clockin_photo_path : String | Nil #

[View source]
def clockin_photo_path=(clockin_photo_path : String | Nil) #

[View source]
def current_organisation!(*args, **options) #

[View source]
def current_organisation!(*args, **options, &) #

[View source]
def current_organisation?(*args, **options) #

[View source]
def current_organisation?(*args, **options, &) #

[View source]
def mode : String #

[View source]
def mode=(mode : String) #

[View source]
def organisations : Array(Organisation) #

[View source]
def organisations=(value : Array(Organisation)) #

[View source]
def overwrite!(site_prefix : String, email : String, access_token : Types::AccessToken) #

[View source]
def pretty_start_of_week : String #

[View source]
def reset_environment! #

[View source]
def save! #

[View source]
def site_prefix : String #

[View source]
def site_prefix=(value : String) #

[View source]
def staging? : Bool #

[View source]
def start_of_week : Time::DayOfWeek #

[View source]
def start_of_week=(value : String) : Time::DayOfWeek | Error::InvalidStartOfWeek #

[View source]
def time_zone : String | Nil #

properties that are delegated based on the current environment


[View source]
def time_zone=(value : String | Nil) #

properties that are delegated based on the current environment


[View source]
def treat_paid_breaks_as_unpaid? : Bool | Nil #

[View source]