Class: EveApp::ItemParser::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/eve_app/item_parser.rb

Constant Summary collapse

REGEX =
/\A\[(.+), (.+)\]\z/

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Header

Returns a new instance of Header.



52
53
54
55
# File 'lib/eve_app/item_parser.rb', line 52

def initialize(text)
  @text = text
  parse_header
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



46
47
48
# File 'lib/eve_app/item_parser.rb', line 46

def name
  @name
end

#textObject (readonly)

Returns the value of attribute text.



46
47
48
# File 'lib/eve_app/item_parser.rb', line 46

def text
  @text
end

#typeObject (readonly)

Returns the value of attribute type.



46
47
48
# File 'lib/eve_app/item_parser.rb', line 46

def type
  @type
end

Class Method Details

.matches?(text) ⇒ Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/eve_app/item_parser.rb', line 48

def self.matches?(text)
  text =~ REGEX
end