Module: Gamefic::Sdk::Tasks::Common
Overview
Common methods for Rake tasks.
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
Instance Method Summary collapse
- #absolute_path ⇒ Object
- #initialize(directory = '.') ⇒ Object
- #plot_class ⇒ Object
- #string_to_constant(string) ⇒ Object
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
12 13 14 |
# File 'lib/gamefic-sdk/tasks/common.rb', line 12 def directory @directory end |
Instance Method Details
#absolute_path ⇒ Object
18 19 20 |
# File 'lib/gamefic-sdk/tasks/common.rb', line 18 def absolute_path @absolute_path ||= Pathname.new(directory).realpath.to_s end |
#initialize(directory = '.') ⇒ Object
14 15 16 |
# File 'lib/gamefic-sdk/tasks/common.rb', line 14 def initialize directory = '.' @directory = directory end |
#plot_class ⇒ Object
22 23 24 |
# File 'lib/gamefic-sdk/tasks/common.rb', line 22 def plot_class GAMEFIC_PLOT_CLASS end |
#string_to_constant(string) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/gamefic-sdk/tasks/common.rb', line 26 def string_to_constant string space = Object string.split('::').each do |part| space = space.const_get(part) end space end |