oxmlk 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/examples/example.rb CHANGED
@@ -31,4 +31,14 @@ class Person
31
31
  def say_hello(xml)
32
32
  'hello'
33
33
  end
34
+ end
35
+
36
+ class Example
37
+ include OxMlk
38
+ end
39
+
40
+ module Test
41
+ class Example
42
+ include OxMlk
43
+ end
34
44
  end
data/lib/oxmlk.rb CHANGED
@@ -38,7 +38,7 @@ module OxMlk
38
38
  end
39
39
 
40
40
  def ox_tag(tag=false)
41
- @ox_tag ||= (tag || self).to_s
41
+ @ox_tag ||= (tag || self).to_s.split('::').last
42
42
  end
43
43
 
44
44
  def xml_array(data)
data/oxmlk.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{oxmlk}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Robinson"]
data/spec/oxmlk_spec.rb CHANGED
@@ -116,5 +116,15 @@ describe OxMlk::ClassMethods do
116
116
  @klass.ox_elems.size.should == 3
117
117
  end
118
118
  end
119
+
120
+ describe '#ox_tag' do
121
+ it 'should default to class name' do
122
+ Example.ox_tag.should == 'Example'
123
+ end
124
+
125
+ it 'should default to class name with module removed' do
126
+ Test::Example.ox_tag.should == 'Example'
127
+ end
128
+ end
119
129
  end
120
130
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxmlk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Robinson