Class: Rosette::Queuing::Commits::CommitsQueueConfigurator
- Inherits:
-
Object
- Object
- Rosette::Queuing::Commits::CommitsQueueConfigurator
- Defined in:
- lib/rosette/queuing/commits/commits_queue_configurator.rb
Overview
Configuration specific to the “commits” queue that processes commits.
Constant Summary collapse
- DEFAULT_DIFF_POINT =
'master'- DEFAULT_PHRASE_GRANULARITY =
PhraseStorageGranularity::COMMIT
Instance Attribute Summary collapse
-
#diff_point ⇒ String
readonly
The diff point to use when computing phrase diffs.
- #name ⇒ String readonly
-
#phrase_storage_granularity ⇒ String
readonly
Determines which set of phrases to push to the TMS.
Instance Method Summary collapse
-
#initialize(name) ⇒ CommitsQueueConfigurator
constructor
Creates a new configurator and sets up a few defaults.
-
#set_diff_point(new_diff_point) ⇒ void
Sets the diff point to use when computing phrase diffs.
-
#set_phrase_storage_granularity(granularity) ⇒ void
Sets the phrase storage granularity, i.e.
Constructor Details
#initialize(name) ⇒ CommitsQueueConfigurator
Creates a new configurator and sets up a few defaults.
31 32 33 34 35 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 31 def initialize(name) @name = name @diff_point = DEFAULT_DIFF_POINT @phrase_storage_granularity = DEFAULT_PHRASE_GRANULARITY end |
Instance Attribute Details
#diff_point ⇒ String (readonly)
Returns the diff point to use when computing phrase diffs. Defaults to “master”. Used only when phrase_storage_granularity is set to [Rosette::Queuing::Commits::PhraseStorageGranularity::BRANCH].
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 21 class CommitsQueueConfigurator DEFAULT_DIFF_POINT = 'master' DEFAULT_PHRASE_GRANULARITY = PhraseStorageGranularity::COMMIT attr_reader :name, :diff_point, :phrase_storage_granularity # Creates a new configurator and sets up a few defaults. # # @param [String] name The name of the queue. # @return [CommitsQueueConfigurator] def initialize(name) @name = name @diff_point = DEFAULT_DIFF_POINT @phrase_storage_granularity = DEFAULT_PHRASE_GRANULARITY end # Sets the phrase storage granularity, i.e. the method used to determine # which set of phrases should get uploaded to the TMS. # # @param [String] granularity One of the constant values in # [Rosette::Queuing::Commits::PhraseStorageGranularity]. # @return [void] def set_phrase_storage_granularity(granularity) @phrase_storage_granularity = granularity end # Sets the diff point to use when computing phrase diffs. Note that this # value is only important when +phrase_storage_granularity+ is set to # [Rosette::Queuing::Commits::PhraseStorageGranularity::BRANCH]. # # @param [String] new_diff_point The diff point to set. # @return [void] def set_diff_point(new_diff_point) @diff_point = new_diff_point end end |
#name ⇒ String (readonly)
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 21 class CommitsQueueConfigurator DEFAULT_DIFF_POINT = 'master' DEFAULT_PHRASE_GRANULARITY = PhraseStorageGranularity::COMMIT attr_reader :name, :diff_point, :phrase_storage_granularity # Creates a new configurator and sets up a few defaults. # # @param [String] name The name of the queue. # @return [CommitsQueueConfigurator] def initialize(name) @name = name @diff_point = DEFAULT_DIFF_POINT @phrase_storage_granularity = DEFAULT_PHRASE_GRANULARITY end # Sets the phrase storage granularity, i.e. the method used to determine # which set of phrases should get uploaded to the TMS. # # @param [String] granularity One of the constant values in # [Rosette::Queuing::Commits::PhraseStorageGranularity]. # @return [void] def set_phrase_storage_granularity(granularity) @phrase_storage_granularity = granularity end # Sets the diff point to use when computing phrase diffs. Note that this # value is only important when +phrase_storage_granularity+ is set to # [Rosette::Queuing::Commits::PhraseStorageGranularity::BRANCH]. # # @param [String] new_diff_point The diff point to set. # @return [void] def set_diff_point(new_diff_point) @diff_point = new_diff_point end end |
#phrase_storage_granularity ⇒ String (readonly)
Returns determines which set of phrases to push to the TMS. Must be one of the constant values in [Rosette::Queuing::Commits::PhraseStorageGranularity].
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 21 class CommitsQueueConfigurator DEFAULT_DIFF_POINT = 'master' DEFAULT_PHRASE_GRANULARITY = PhraseStorageGranularity::COMMIT attr_reader :name, :diff_point, :phrase_storage_granularity # Creates a new configurator and sets up a few defaults. # # @param [String] name The name of the queue. # @return [CommitsQueueConfigurator] def initialize(name) @name = name @diff_point = DEFAULT_DIFF_POINT @phrase_storage_granularity = DEFAULT_PHRASE_GRANULARITY end # Sets the phrase storage granularity, i.e. the method used to determine # which set of phrases should get uploaded to the TMS. # # @param [String] granularity One of the constant values in # [Rosette::Queuing::Commits::PhraseStorageGranularity]. # @return [void] def set_phrase_storage_granularity(granularity) @phrase_storage_granularity = granularity end # Sets the diff point to use when computing phrase diffs. Note that this # value is only important when +phrase_storage_granularity+ is set to # [Rosette::Queuing::Commits::PhraseStorageGranularity::BRANCH]. # # @param [String] new_diff_point The diff point to set. # @return [void] def set_diff_point(new_diff_point) @diff_point = new_diff_point end end |
Instance Method Details
#set_diff_point(new_diff_point) ⇒ void
This method returns an undefined value.
Sets the diff point to use when computing phrase diffs. Note that this value is only important when phrase_storage_granularity is set to [Rosette::Queuing::Commits::PhraseStorageGranularity::BRANCH].
53 54 55 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 53 def set_diff_point(new_diff_point) @diff_point = new_diff_point end |
#set_phrase_storage_granularity(granularity) ⇒ void
This method returns an undefined value.
Sets the phrase storage granularity, i.e. the method used to determine which set of phrases should get uploaded to the TMS.
43 44 45 |
# File 'lib/rosette/queuing/commits/commits_queue_configurator.rb', line 43 def set_phrase_storage_granularity(granularity) @phrase_storage_granularity = granularity end |