Class: RbsMiniMagick::Flows::State
- Inherits:
-
Object
- Object
- RbsMiniMagick::Flows::State
- Defined in:
- lib/rbs_mini_magick/flows/state.rb
Overview
RbsMiniMagick::Flows::State
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #concat_rbs(new_rbs) ⇒ RbsMiniMagick::Flows::State
- #fetch_tool_usage(tool_name) ⇒ RbsMiniMagick::ImageMagick::ToolUsage
- #formated_rbs ⇒ String
- #initialize(tool_usages:, rbs:) ⇒ void constructor
Constructor Details
#initialize(tool_usages:, rbs:) ⇒ void
22 23 24 25 26 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 22 def initialize(tool_usages:, rbs:) @tool_usages = tool_usages @tool_usage_by_name = tool_usages.to_h { [_1.name, _1] } @rbs = rbs end |
Instance Attribute Details
#tool_usages ⇒ Array<RbsMiniMagick::ImageMagick::ToolUsage> (readonly)
17 18 19 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 17 def tool_usages @tool_usages end |
Class Method Details
.init(tool_usages:) ⇒ RbsMiniMagick::Flows::State
10 11 12 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 10 def init(tool_usages:) new(tool_usages: tool_usages, rbs: "") end |
Instance Method Details
#concat_rbs(new_rbs) ⇒ RbsMiniMagick::Flows::State
36 37 38 39 40 41 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 36 def concat_rbs(new_rbs) self.class.new( tool_usages: tool_usages, rbs: [rbs, new_rbs].join("\n") ) end |
#fetch_tool_usage(tool_name) ⇒ RbsMiniMagick::ImageMagick::ToolUsage
30 31 32 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 30 def fetch_tool_usage(tool_name) tool_usage_by_name.fetch(tool_name) end |
#formated_rbs ⇒ String
44 45 46 |
# File 'lib/rbs_mini_magick/flows/state.rb', line 44 def formated_rbs @formated_rbs ||= format_rbs end |