Class: Texter::BuildText

Inherits:
Object
  • Object
show all
Includes:
CallableClass
Defined in:
app/lib/texter/build_text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, tag_type, virtual_path) ⇒ BuildText

Returns a new instance of BuildText.

Parameters:

  • path (String)
  • tag_type (Symbol)

    (:block, :inline)

  • virtual_path (String, NilClass)


10
11
12
13
14
# File 'app/lib/texter/build_text.rb', line 10

def initialize(path, tag_type, virtual_path)
  @path         = path
  @tag_type     = tag_type
  @virtual_path = virtual_path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'app/lib/texter/build_text.rb', line 5

def path
  @path
end

#tag_typeObject (readonly)

Returns the value of attribute tag_type.



5
6
7
# File 'app/lib/texter/build_text.rb', line 5

def tag_type
  @tag_type
end

#virtual_pathObject (readonly)

Returns the value of attribute virtual_path.



5
6
7
# File 'app/lib/texter/build_text.rb', line 5

def virtual_path
  @virtual_path
end

Instance Method Details

#callObject



16
17
18
19
20
# File 'app/lib/texter/build_text.rb', line 16

def call
  text = Texter::Text.find_or_initialize_by_path(full_path)
  text.tag_type = tag_type
  text
end