Class: Stratagem::Model::Component::StaticFile

Inherits:
Base
  • Object
show all
Defined in:
lib/stratagem/model/components/static_file.rb

Constant Summary

Constants included from ParseUtil

ParseUtil::RUBY_OUTPUT_REGEX, ParseUtil::RUBY_REGEX

Instance Attribute Summary

Attributes inherited from Base

#app_model, #klass, #parse_tree, #path, #source

Instance Method Summary collapse

Methods inherited from Base

#==, load_all, logger, #logger, #name

Methods included from ParseUtil

find_classes, #gsub_ruby_blocks, qualified_class_name, #ruby_blocks, #ruby_output_blocks

Constructor Details

#initialize(public_path) ⇒ StaticFile

Returns a new instance of StaticFile.



4
5
6
# File 'lib/stratagem/model/components/static_file.rb', line 4

def initialize(public_path)
  @path = public_path
end

Instance Method Details

#full_pathObject



12
13
14
# File 'lib/stratagem/model/components/static_file.rb', line 12

def full_path
  File.join(RAILS_ROOT, 'public', path)
end

#readObject



8
9
10
# File 'lib/stratagem/model/components/static_file.rb', line 8

def read
  File.read(full_path)
end