Class: Lino::Model::Argument

Inherits:
Object
  • Object
show all
Defined in:
lib/lino/model/argument.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argument) ⇒ Argument

Returns a new instance of Argument.



8
9
10
# File 'lib/lino/model/argument.rb', line 8

def initialize(argument)
  @argument = argument
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



6
7
8
# File 'lib/lino/model/argument.rb', line 6

def argument
  @argument
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



22
23
24
25
# File 'lib/lino/model/argument.rb', line 22

def ==(other)
  self.class == other.class &&
    state == other.state
end

#arrayObject



17
18
19
# File 'lib/lino/model/argument.rb', line 17

def array
  [argument.to_s]
end

#hashObject



28
29
30
# File 'lib/lino/model/argument.rb', line 28

def hash
  [self.class, state].hash
end

#stringObject Also known as: to_s, to_a



12
13
14
# File 'lib/lino/model/argument.rb', line 12

def string
  argument.to_s
end