Class: TripleParser::TMaker

Inherits:
Object
  • Object
show all
Defined in:
lib/triple_parser/t_maker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TMaker

Returns a new instance of TMaker.



17
18
19
# File 'lib/triple_parser/t_maker.rb', line 17

def initialize(*args)
  @string = args.first
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



10
11
12
# File 'lib/triple_parser/t_maker.rb', line 10

def arguments
  @arguments
end

#rdf_styleObject

Returns the value of attribute rdf_style.



10
11
12
# File 'lib/triple_parser/t_maker.rb', line 10

def rdf_style
  @rdf_style
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/triple_parser/t_maker.rb', line 10

def url
  @url
end

Class Method Details

.brew(*args) ⇒ Object



12
13
14
15
# File 'lib/triple_parser/t_maker.rb', line 12

def self.brew(*args)
  t_maker = new(*args)
  t_maker.third
end

Instance Method Details

#split_textObject



36
37
38
# File 'lib/triple_parser/t_maker.rb', line 36

def split_text
  @split_text ||= get_split_text
end

#thirdObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/triple_parser/t_maker.rb', line 21

def third
  begin
    Third.new(
      @string,
      :type => split_text.type,
      :value => split_text.value,
      :url => split_text.url,
      :rdf_style => split_text.rdf_style,
      :arguments => split_text.arguments
    )
  rescue
    Third.new(@string, :rdf_style => 'unknown')
  end
end