Class: MasterView::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/masterview/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directives, tag_name, attributes, mode_type, parent) ⇒ Tag

Returns a new instance of Tag.



156
157
158
159
160
161
162
163
164
165
# File 'lib/masterview/parser.rb', line 156

def initialize(directives, tag_name, attributes, mode_type, parent)
  @tag_name = tag_name
  @attributes = attributes
  @mode_type = mode_type
  @directives = directives
  @stag = []
  @content = []
  @etag = []
  @parent = parent
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def attributes
  @attributes
end

#contentObject

Returns the value of attribute content.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def content
  @content
end

#directivesObject

Returns the value of attribute directives.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def directives
  @directives
end

#etagObject

Returns the value of attribute etag.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def etag
  @etag
end

#mode_typeObject

Returns the value of attribute mode_type.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def mode_type
  @mode_type
end

#parentObject

Returns the value of attribute parent.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def parent
  @parent
end

#stagObject

Returns the value of attribute stag.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def stag
  @stag
end

#tag_nameObject

Returns the value of attribute tag_name.



155
156
157
# File 'lib/masterview/parser.rb', line 155

def tag_name
  @tag_name
end

Instance Method Details

#create_context(values = {}) ⇒ Object

creates a tag context using tag itself and mode type, also merge in any additional values passed in via values hash



169
170
171
172
173
174
# File 'lib/masterview/parser.rb', line 169

def create_context( values = {} )
  { 
    :tag => self,
    :mode_type => @mode_type
  }.merge!(values)
end

#dataObject



176
177
178
# File 'lib/masterview/parser.rb', line 176

def data
  [] << @stag << @content << @etag
end