Class: CartoCSSHelper::TagRenderingStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/cartocss_helper/tag_lister.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, state, composite = nil) ⇒ TagRenderingStatus

Returns a new instance of TagRenderingStatus.



11
12
13
14
15
16
# File 'lib/cartocss_helper/tag_lister.rb', line 11

def initialize(key, value, state, composite = nil)
  @key = key
  @value = value
  @state = state
  @composite = composite
end

Instance Attribute Details

#compositeObject

Returns the value of attribute composite.



10
11
12
# File 'lib/cartocss_helper/tag_lister.rb', line 10

def composite
  @composite
end

#keyObject

Returns the value of attribute key.



10
11
12
# File 'lib/cartocss_helper/tag_lister.rb', line 10

def key
  @key
end

#stateObject

Returns the value of attribute state.



10
11
12
# File 'lib/cartocss_helper/tag_lister.rb', line 10

def state
  @state
end

#valueObject

Returns the value of attribute value.



10
11
12
# File 'lib/cartocss_helper/tag_lister.rb', line 10

def value
  @value
end

Instance Method Details

#code_printObject



26
27
28
29
30
31
# File 'lib/cartocss_helper/tag_lister.rb', line 26

def code_print
  string = "Status.new('#{@key}', '#{@value}', :#{@state}"
  string << ", #{@composite}" if @composite != nil
  string << '),'
  puts string
end


18
19
20
21
22
23
24
# File 'lib/cartocss_helper/tag_lister.rb', line 18

def print
  composite_string = ''
  if composite
    composite_string = "- rendered with #{@composite.to_s.gsub('=>', '=')}, maybe also other sets of tags"
  end
  puts "#{@key}=#{@value} #{@state} #{composite_string}"
end