Class: Rpictogrify::Themes::Base
- Inherits:
-
Object
- Object
- Rpictogrify::Themes::Base
show all
- Extended by:
- SingleForwardable
- Includes:
- Singleton
- Defined in:
- lib/rpictogrify/themes/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
17
18
19
20
21
|
# File 'lib/rpictogrify/themes/base.rb', line 17
def initialize
@ident = get_ident
@mapping = parse_mapping
@resource = parse_resource
end
|
Instance Attribute Details
#ident ⇒ Object
Returns the value of attribute ident.
13
14
15
|
# File 'lib/rpictogrify/themes/base.rb', line 13
def ident
@ident
end
|
#mapping ⇒ Object
Returns the value of attribute mapping.
13
14
15
|
# File 'lib/rpictogrify/themes/base.rb', line 13
def mapping
@mapping
end
|
#resource ⇒ Object
Returns the value of attribute resource.
13
14
15
|
# File 'lib/rpictogrify/themes/base.rb', line 13
def resource
@resource
end
|
Instance Method Details
#colors ⇒ Object
35
36
37
|
# File 'lib/rpictogrify/themes/base.rb', line 35
def colors
mapping['colors']
end
|
#height ⇒ Object
27
28
29
|
# File 'lib/rpictogrify/themes/base.rb', line 27
def height
view_box[3]
end
|
#shapes ⇒ Object
31
32
33
|
# File 'lib/rpictogrify/themes/base.rb', line 31
def shapes
mapping['shapes']
end
|
#symbol(id) ⇒ Object
39
40
41
|
# File 'lib/rpictogrify/themes/base.rb', line 39
def symbol(id)
resource.at_xpath("//*[@id='#{id}']")
end
|
#width ⇒ Object
23
24
25
|
# File 'lib/rpictogrify/themes/base.rb', line 23
def width
view_box[2]
end
|