Class: Smartdown::Model::Predicate::Named

Inherits:
Struct
  • Object
show all
Defined in:
lib/smartdown/model/predicate/named.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/smartdown/model/predicate/named.rb', line 4

def name
  @name
end

Instance Method Details

#evaluate(state) ⇒ Object



5
6
7
# File 'lib/smartdown/model/predicate/named.rb', line 5

def evaluate(state)
  !!state.get(name)
end

#humanizeObject



9
10
11
# File 'lib/smartdown/model/predicate/named.rb', line 9

def humanize
  "#{name.to_s.chomp('?')}?"
end